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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dragging Columns on a Data Bound Grid

Thread ID:





17901 Aug 19,2004 10:17 AM UTC Aug 19,2004 10:47 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On August 19, 2004 10:17 AM UTC

I''m sure I''ve been able to reorder columns on a GridDataBoundGrid by dragging and dropping. Playing with the "DataBoundSortByDisplayMember" sample I cannot get this to work. Is it supported? What do I need to change in the sample to get this to work? With GridGroupingControl is just works. I''m using SyncFusion Thanks, Ben.

Administrator [Syncfusion]
Replied On August 19, 2004 10:47 AM UTC

That sample turned off column moving so a single click could sort the column instead of selecting it for moving. To turn it back on, you simply do step 5 below. But this may look strange to you as it sorts and selects for moving at the same time. One work around would be to use a double click to sort. But this requires more than just setting the SortBehavior property in the sample since the sample uses events to change the default sort behavior. Below are the steps I took to make that sample sort on a double click and select for moving on a single click. 1) In gridDataBoundGrid1_CellClick, set bool VersionGreater1618 = true; 2) COmment out the OnCellClick override in the derived class, DataBoundGrid. (Or don''t use it). 3) Instead of subscribing to grid.CellClick, subscribe to grid.CellDoubleClick to sort on a double click. You can use the exact same handler, gridDataBoundGrid1_CellClick, as the CellClick used (with the change from #1). 4) change grid.SortBehavior property to none (instead of double click). This is in two places. 5) Add the GridSelectionFlags.Column flag to the this.gridDataBoundGrid1.AllowSelection property.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon