Hi,
I have an unbound simple grid with editable cells in it. I carry out a number of edits, which all work fine. But when the user wants to repopulate the grid, I call my refresh code, which includes completely rebuilding the grid. As part of that code I call
To clear out the entire grid. I then follow a standard routing for repopulation adding columns and rows as required. Subsequently all attempts to set .CurrentRow, or to click between cells returns a NullReferenceException as shown in the stack below.
I suspect my problem is that I'm not "telling" the grid to clear itself properly but cannot find a wholesale "ClearAll" method. I also suspect the problem relates to tracking of the current Cell as there is a lot of dependence on there being a current cell inside EndEditCore, and its not explicitly checked for Null.
Can you assist ?
(My stack trace below).
I have an unbound simple grid with editable cells in it. I carry out a number of edits, which all work fine. But when the user wants to repopulate the grid, I call my refresh code, which includes completely rebuilding the grid. As part of that code I call
Telerik.WinControls.UI.
ColumnGroupsViewDefinition columnGroupsDefinition = this.radGridView.ViewDefinition as Telerik.WinControls.UI.ColumnGroupsViewDefinition;
columnGroupsDefinition.ColumnGroups.Clear();
if (this.radGridView.Columns.Count > 0) this.radGridView.Columns.Clear();
if(this.radGridView.Rows.Count > 0) this.radGridView.Rows.Clear();
To clear out the entire grid. I then follow a standard routing for repopulation adding columns and rows as required. Subsequently all attempts to set .CurrentRow, or to click between cells returns a NullReferenceException as shown in the stack below.
I suspect my problem is that I'm not "telling" the grid to clear itself properly but cannot find a wholesale "ClearAll" method. I also suspect the problem relates to tracking of the current Cell as there is a lot of dependence on there being a current cell inside EndEditCore, and its not explicitly checked for Null.
Can you assist ?
(My stack trace below).
An unhandled exception has occured with the following details | |
Message | Object reference not set to an instance of an object. |
Stack Trace |
at Telerik.WinControls.UI.RadGridView.EndEditCore(Boolean cancel, Boolean finishEditingOperation) at Telerik.WinControls.UI.RadGridView.EndEdit() at Telerik.WinControls.UI.RadGridView.ValidatePositionChange(GridViewRowInfo rowInfo, GridViewColumn column) at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDownLeft(MouseEventArgs e) at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e) at Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) |
Additional Data | |
TicketNumber | 21c900c6-0ab5-4f64-bc53-839a3a783e45 |