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

UpdateColumnWidths exception

Hello, I''m getting the exception (pasted below) when I remove my GridGroupingControl from the Controls collection (this.Controls.Remove()) of my UserControl. The only way I can avoid this error is to set AllowCalculateMaxColumnWidth to false before removing the GroupingGrid from the controls collection. It may have something to do with the fact that I''m setting the grid DataSource to null before removing it from the controls as it seems to be trying to resize the columns when there is nothing in the DataSource. Any ideas how to get around this? thanks, Heath ************** Exception Text ************** System.IndexOutOfRangeException: Index was outside the bounds of the array. at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths(Boolean force) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.UpdateScrollBars() at Syncfusion.Windows.Forms.Grid.GridControlBase.OnSizeChanged(EventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.OnSizeChanged(EventArgs e) at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) at System.Windows.Forms.Control.UpdateBounds() at System.Windows.Forms.Control.WmWindowPosChanged(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.WndProc(Message& msg) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

1 Reply

AD Administrator Syncfusion Team May 18, 2005 01:18 AM UTC

I am not sure this will serve your needs or not. But this code did not throw any exceptions for me. this.gridGroupingControl1.DataSource = null; this.gridGroupingControl1.Visible = false; this.Controls.Remove(gridGroupingControl1); gridGroupingControl1.Dispose(); gridGroupingControl1 = null;

Loader.
Up arrow icon