Validator

Hello,

how i can validate grid cell value on row editing/adding?
I try with DatasourceContolRowAdding/Editing event but if i set the e.Cancel = true property the row isn't insert in the grid but the row on the grid return at original state loosing all the data and i need to click an another time on the grid row to set it in add new/edit row mode and i must insert all the data an another time. It is possibile also validate the grid data by jquery or javascript on client side? 

Thanks in advice,
Fabio

1 Reply

YO Yogeshwaran Syncfusion Team June 8, 2012 02:09 PM UTC

Hi Fabio,

 In our current architecture client side validation is not possible . we have to validate this on serve side event “CurrentRecordContextChange” . we have validated for adding record .please refer the

Following code snippe

private void GridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)

{

 

if (e.Action == CurrentRecordAction.EndEditComplete && val == false)

{

 

this.GridGroupingControl1.Table.LastChangedRecord.Delete();

this.GridGroupingControl1.Table.AddNewRecord.BeginEdit();

 

}

}

For your convenience , we have created sample and can be downloaded from below link.

ColumnWidth-GridWeb.zip

Please let us know if you have any concerns.

Regards,

Yogesh R


Loader.
Up arrow icon