AD
Administrator
Syncfusion Team
March 28, 2008 09:53 PM UTC
Hi Harry,
Thanks for using Syncfusion products.
You can validate the data before insert into the grid by using "CurrentRecordContextChange" event. Please refer the below given code snippet:
private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if (e.Action == CurrentRecordAction.EndEditCalled && e.Record.Kind == DisplayElementKind.AddNewRecord)
{
Record rec = e.Record.GetRecord();
//You can validate this data.
if (((e.Record.GetRecord().GetValue("Rate") == null) || (e.Record.GetRecord().GetValue("Rate").ToString().Length == 0)))
{
MessageBox.Show("Invalid data");
e.Cancel = true;
}
}
}
Please let me know if you have any questions.
Best regards,
Haneef