We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error when entering data after deleting rows

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.GridModelDataBinder.BeginEdit() at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.BeginEdit() at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellChanging(CancelEventArgs e) at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellChanging() at Syncfusion.Windows.Forms.Grid.GridCurrentCell.NotifyChanging() at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.NotifyCurrentCellChanging() 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. Thanks!

1 Reply

GS Greg Shomette August 4, 2004 06:12 PM UTC

Sorry, somehow I posted this in the Essential Edit forum, and it should be in the Essential Grid forum.

Loader.
Up arrow icon