Completed
Last Updated: 11 Sep 2017 10:27 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 09 Aug 2017 07:40
Category: GridView
Type: Bug Report
0
FIX. RadGridView - error message "Column 'Name' does not allow nulls" is shown when the AddNewBoundRowBeforeEdit property is set to true and the user try to add new record
To reproduce: bind the grid to a DataTable where one of the columns doesn't allow null values. Try to add a new record by using the new row in the grid. Even though you specify default values in the DefaultValuesNeeded event, the error still occurs. Please refer to the attached sample project and gif file.

Workaround: handle the RadGridView.DataError event:

private void RadGridView1_DataError(object sender, Telerik.WinControls.UI.GridViewDataErrorEventArgs e)
{
    if (e.Exception.ToString().Contains("does not allow nulls"))
    {
        e.Cancel = true;
    }
}
0 comments