I need to be able to remove a column from a GDBG based on a context menu action. My context menu handler code looks something like this:
// ... determine what GBCs to remove
this._grid.BeginUpdate();
this._grid.Binder.SuspendBinding();
foreach (GridBoundColumn gbc in remove)
this._grid.GridBoundColumns.Remove(gbc);
this._grid.Binder.ResumeBinding();
this._grid.EndUpdate(true);
this._grid.Refresh();
this._grid.UpdateScrollBars();
While this seems to remove the column, the grid ends up with a bogus, empty column on the far right of the grid. It''s as if columns were slid to the left to fill in the gap but the leftover space wasn''t trimmed off.
What am I missing?
AD
Administrator
Syncfusion Team
February 28, 2005 07:03 PM UTC
Try also calling
grid.Binder.InitializeColumns after removing the column to see if this takes care of this problem.
BD
Bruce Davis
February 28, 2005 09:23 PM UTC
The call to InitializeColumns() did the trick. Thanks for your help.