|
-
Sep 23rd, 2003, 06:34 AM
#1
Thread Starter
New Member
Datagrid Data validation
I am working on a small demo application for Data Editing and Cheking. I tried it doing with DataGrid, Tlist, dxDBGrid (Quantum Express). Our Main requiremnet is inplace editing with Data validation. Validation Mainly include specific strings such as 1,2,3A,4D,AAA,100 or range of values like 1 to 100, 3A to 9A etc.. Also if a user enters a wrong value, the cell should be reflect the original value and the focus on the same cell.
What I want to make sure is unless a person enters a valid Data, he should not be allowed to do anything but to edit that particular eroneous cell.. No change of columns or no vertical scrolling not even focus on another control. Something like a lost focus of a text box.
Kindly Help
Parag Sinkar
India
-
Sep 24th, 2003, 06:20 PM
#2
Addicted Member
What I want to make sure is unless a person enters a valid Data, he should not be allowed to do anything but to edit that particular eroneous cell.. No change of columns or no vertical scrolling not even focus on another control. Something like a lost focus of a text box.
there's two usefull event for you. one is BeforeColUpdate you can put something like this inside
If datagrid1.Text <> "Valid" Then
MsgBox Error
LastRowNo = adoSupplier.Recordset.AbsolutePosition
LastColNo = ColIndex
datagrid1.SetFocus
datagrid1.Col = ColIndex
datagrid1.SelLength = Len(adoSupplier.Recordset!SupplierName)
End If
and another event is VALIDATE which you can put something like that inside which will focus back on that speciall cell in case that its not valid
If datagrid1.Text <> "Valid" Then
MsgBox "ERROR"
datagrid1.SetFocus
datagrid1.Col = LastColNo
adoSupplier.Recordset.AbsolutePosition = LastRowNo
End If
actually I didn't test it exactly but if you need accurate code let me know.
-
Jun 7th, 2004, 09:51 PM
#3
Addicted Member
I am concerning about this stuff too , i know this thread is a kind of old age , but its contents still help many .
If you have source code for this , please post here .
Thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|