How to validate datarow

Hi,all Syncfusion has provided an interesting control,espeicially its Datagrid. I''m now testing it. Could it validate a datarow before the cursor jumps to the next/new line? If the validation fails, the cursor should stay where it was. I know how to validate a datacolumn. But if the user inputs some fields in a new datarow and avoid others fields in this row. Not all the fields'' datacolumn Changing event will triger. So it''s unacceptalbe to validate a row by validating all the fields in the row. thx.

5 Replies

AD Administrator Syncfusion Team December 10, 2004 07:41 AM UTC

You can subscribe to the RowLeave event . There do your row level validation. If it fails, set e.Cancel = true.


VR Vlad Romanchik September 9, 2005 07:15 PM UTC

I need to do validation of new records but only in the GridGroupingControl. Which events can I use to cancel addition of a the record if it fails validation. >You can subscribe to the RowLeave event . There do your row level validation. If it fails, set e.Cancel = true.


AD Administrator Syncfusion Team September 12, 2005 10:41 AM UTC

Hi Vlad, You can make use of the following 2 events . 1) CurrentRecordContextChange 2) CurrentCellValidating But I would prefer "CurrentRecordContextChange" as it has more options and it can also stop from moving the current record, if it finds invalid data. In the sample attached, I implemented the both and commented the one at a time. Best Regards Mouli.


AD Administrator Syncfusion Team September 12, 2005 10:42 AM UTC

Hi Vlad, You can make use of the following 2 events . 1) CurrentRecordContextChange 2) CurrentCellValidating But I would prefer "CurrentRecordContextChange" as it has more options and it can also stop from moving the current record, if it finds invalid data. In the sample attached, I implemented the both and commented the one at a time. Best Regards Mouli.


AD Administrator Syncfusion Team September 12, 2005 10:43 AM UTC


Loader.
Up arrow icon