Repro steps:
Expected behavior:
Observed behavior:
Hi, Martin,
If you try to set a value to a cell in RadGridView that violates the settings in the DataTable, you are expected to observe the following error:
this.radGridView1.Rows[0].Cells["Title"].Value = "This is a very long string";
The DataError event will play an important role in this situation which allows you to handle this case. This event offers GridViewDataErrorEventArgs which is a derivative of CancelEventArgs from where the Cancel argument is inherited. However, the Cancel argument is not used in this case. It is just enough to subscribe to the DataError event and the above error message wouldn't be shown to the end user. If you decide to notify the user for the incorrect data, you can show a message:
private void radGridView1_DataError(object sender, GridViewDataErrorEventArgs e)
{
RadMessageBox.Show(e.Exception.Message);
}
I believe that it would be helpful for achieving your goal.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.