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

Moving columns

Hi,

I'm having an issue trying to find which code deals with the moving of columns ...

I'm having a weird issue that if I move any column before column 3 and then try to move it somewhere else I get the following error:

============================================
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.Grid.Grouping.GroupDragHeaderMouseControllerBase.UpdateRedArrowIndicator()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDragHeaderMouseController.MouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridNestedTableControlCellRenderer.OnMouseMove(Int32 rowIndex, Int32 colIndex, MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.RaiseMouseMove(Int32 rowIndex, Int32 colIndex, MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.MouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlMouseMoveHandled(Object sender, MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlHandledMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.ScrollControl.OnMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnMouseMove(MouseEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(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)
============================================

Note: strangely if I move the original column 3 somewhere else and then move any column before the 'what now becomes the new' column 3 I don't get the issue.


Also somewhere in the code it has been fixed so that columns 1 and 2 can't be moved.

Note: I'm taking over someone else's code hence the question.

Thanks
Ian S.


3 Replies

SR Sri Rajan Syncfusion Team June 27, 2008 12:31 PM UTC

Hi Ian,

Thank you for your interest in Syncfusion products.

Here is the code and minimal sample to move the columns of the GridGroupingControl programatically.

this.gridGroupingControl1.TableDescriptor.VisibleColumns[1].Name = "Col4";
this.gridGroupingControl1.TableDescriptor.VisibleColumns[4].Name = "Col1";
this.gridGroupingControl1.TableDescriptor.VisibleColumns[2].Name = "Col0";
this.gridGroupingControl1.TableDescriptor.VisibleColumns[0].Name = "Col2";


Sample:
http://websamples.syncfusion.com/samples/grid.windows/F74753/main.htm

Please try this and let me know if you are again having the same problem.

Best Regards,
Srirajan




AD Administrator Syncfusion Team June 27, 2008 07:56 PM UTC

Hi there,

I found that this was due to a corrupt grid XML file.

Could you recommend an XML editor that can be used to manually edit the grid generated XML file?

Thanks
Ian S.



SR Sri Rajan Syncfusion Team June 30, 2008 07:18 AM UTC

Hi Ian,

Thank you for your continued interest in Syncfusion products.

You can use notepad to edit XML files.

Please let me know if you have any further questions.

Best Regards,
Srirajan.


Loader.
Live Chat Icon For mobile
Up arrow icon