I appreciate the great support you provide!
We have a GridDataBoundGrid bound to a child table in a dataset. The grid displays TimeCardDetails children of one TimeCard parent at a time. Before deleting the parent record we call CurrentCell.EndEdit() and Binder.EndEdit(). The child records are successfully deleted and the grid is clear of data.
When going into the grid to try and enter new data is when the issue occurs. If one child row was there before the delete we can enter new data without problem. Our code creates a new TimeCard parent when the first detail is added to the grid for the selected day. However, if more than one row of details was in the grid before deletion we get an null reference error.
Here is part of the stack:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellChanging(CancelEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridTextBoxCellRenderer.set_TextBoxText(String value)
at Syncfusion.Windows.Forms.Grid.GridDropDownGridListControlCellRenderer.SetComboBoxText(String s, Boolean validate, Int32 index)
at Syncfusion.Windows.Forms.Grid.GridDropDownGridListControlCellRenderer.ListControlMouseUp(Object sender, MouseEventArgs e)
You can see that the error occurs when the GridModelDataBinder.BeginEdit() method is called. Do we need to reset the binder or do something else to create a blank slate? It works fine when there hasn''t just been a delete.
We are coding in VB.Net.