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

columns order

Hello everybody, Could you please help on how can i change the order of columns in all of the syncfusion grids, for example, i have this order, col1,col2,col3 .... coln and i want to move to the other order : col7,col2,coln,col3,.......col1 i have already used moverange method withing a complex algo, but it takes time to change the order, Thank you very much

4 Replies

ST stanleyj Syncfusion Team January 24, 2006 09:47 AM UTC

Hi, Moving columns programmatically using MoveRange to order does not seems to be very slow. Here is a rough sample. If you like column order to be serialized, refer How do I save column order and column width preferences of my user . Regards, Stanley


AD Administrator Syncfusion Team January 24, 2006 12:09 PM UTC

Thanks a lot Stanley, Greate, it does works very well, it''s excaclty what i need, Thank you very much Regards, >Hi, > >Moving columns programmatically using MoveRange to order does not seems to be very slow. Here is a rough sample. >If you like column order to be serialized, refer How do I save column order and column width preferences of my user . > >Regards, >Stanley


QU QLT User February 9, 2016 11:23 PM UTC

cant find the rough sample mentioned in the response. where is it located ?


PK Pavithra Kodiyarasan Syncfusion Team February 10, 2016 01:29 PM UTC

Hi,

Thank you for using syncfusion product,

You can change the Column order by using Following methods:

Controlleroptions:

This property used to provide the support for mouse controller on the GridControl.

Code Snippet:
this.gridControl1.ControllerOptions = Syncfusion.Windows.Forms.Grid.GridControllerOptions.DragColumnHeader;

DragColumnHeader option enables a mouse controller that provide support for dragging column headers within the grid by clicking on a header and dragging it to a new position.

MoveRange():
This method is used to moves a range of rows and columns.

Code snippet:
this.gridControl1.Cols.MoveRange(6, 2, 1); //Move Column 6 and 7 to the 1st column position.

Sample:
http://www.syncfusion.com/downloads/support/forum/39985/ze/WindowsFormsApplication1-407124893

Regards,
Pavithra K.

Loader.
Live Chat Icon For mobile
Up arrow icon