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
close icon

Drag and drop for grid records..

I''ve a data grid containing 3 records... is it possible for me to drag the 3rd record to be in the first position ?

1 Reply

AD Administrator Syncfusion Team February 17, 2005 09:53 AM UTC

Not really. Moving records in a DataTable is not something that can be done. You can use a DataView and have a specicial column with a special sort order that allows the rows to be displayed in a different order. Here is a KB discussing how you can move rows in such a manner. http://www.syncfusion.com/Support/article.aspx?id=10379 It does it by clicking buttons. If you want to support D&D, then you would have to add that type of interface onto this row moving fucntionality. To get the UI to show moving rows, you can do: this.gridDataBoundGrid1.Model.Options.AllowDragSelectedRows = true; this.gridDataBoundGrid1.Model.RowsMoved += new GridRangeMovedEventHandler(Model_RowsMoved); This will let you user mouse down on a row header to select it, and then mousedown a second time to drag it. In the event handler, Model_RowsMoved, you would need to use the dataview technique to reorder the rows.

Loader.
Live Chat Icon For mobile
Up arrow icon