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

Drag & move columns in dataBoundGrid

are there any events catching drag and move columns? I am planning to move columns by catching the ColIndex, converting it to mappingName and then re-arrange the LayoutColumns string[]. However, I can''t manage to find some that is similar to dragdrop?

5 Replies

AD Administrator Syncfusion Team April 23, 2004 11:32 AM

Moving columns is support by default in a GridDataBoundGrid. If you click a colheader to select the column, then if you mousedown on the selected column header, you can drag and drop it in another position. If you do not see this behavior, check the AllowDragSelectedCols property to make sure it is on. Another reason you might not see this default behavior is if you have ListBoxSelectionMode set to something other than none. With ListBoxSelectionMode set, the default behavior is to not allow selecting columns (since you can only select rows). Here is a forum thread with a work around. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12055


VL Vincent Lo April 23, 2004 01:04 PM

Thanks for advice... i have re-enable the selection to "Cell, Column" and now it works. However, I have got 2 hierarchies of table with identical columns. I want columns in both tables to move to the same position. Is there any property i can set or what code i can use to move the respective columns?


AD Administrator Syncfusion Team April 23, 2004 05:45 PM

There are no property settings that support moving child row headers in a hierarchical GridDataBoundGrid. (You can do this in a GridGroupingControl). If you want to implement this behavior in a GridDataBoundGrid, you will have to design/implement this yourself. Here is a link to a forum thread that has a sample that lets you move a column by just mousing down on it (not having to select it first). Maybe you can use something similar to implement your requirements. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=9676


VL Vincent Lo April 24, 2004 02:10 AM

How can i access the moveRange property for my child table in the lower hierarchy? when i do gridDataBoundGrid1.Model.Cols.MoveRange(3,1,1) I can move the parent table but could you advise if there''s something similar i can code to instruct the child table to move?


VL Vincent Lo April 24, 2004 02:24 AM

I have achieved it by reading in the names of the internal columns after col moving and using LayoutColumns to assign it to columns in my child table. Any better suggestions?? >How can i access the moveRange property for my child table in the lower hierarchy? > >when i do >gridDataBoundGrid1.Model.Cols.MoveRange(3,1,1) >I can move the parent table but could you advise if there''s something similar i can code to instruct the child table to move?

Loader.
Live Chat Icon For mobile
Up arrow icon