This is a migrated thread and some comments may be shown as answers.

Drag and Drop

6 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
The KID
Top achievements
Rank 2
The KID asked on 09 Jul 2008, 10:40 PM
Can anyone tell me more about the drag and drop feature with the grid? I have a simple grid that i want to be able to reorder the items, and once the items are in correct order i can use a button to loop through and retrieve that order. So far i can only select on a row but when i move the row it goes back to it's original order.

Thanks

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Jul 2008, 06:21 AM
Hello Mike,

Please check the description in this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/DragAndDrop/DefaultCS.aspx

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
The KID
Top achievements
Rank 2
answered on 29 Jul 2008, 05:22 PM
Yes, I have already looked at those. The problem is that in your examples you're using ILists which works fine for your demos because you're not committing any changes to your data. Is there anything out there when you're binding to DataSet and need to bind the order back to the database?
0
Rosen
Telerik team
answered on 31 Jul 2008, 01:23 PM
Hi Mike,

In order to reorder data in the DB you should store the records' order in the backend. For example, by adding a new column to the database table. Then when the order is changed, you should update this column. Please find attached a simple implementation representing the aforementioned approach.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matt
Top achievements
Rank 2
answered on 10 Sep 2008, 09:33 PM
Hi,

This demo does not seem to work, the list does not change and the database remains unchanged?

I have plugged it into my project using the Q2 release of RadGrid.

Any ideas?

Tony.
0
Matt
Top achievements
Rank 2
answered on 11 Sep 2008, 08:35 AM
Okay, sorry - it does work, but inconsistently.  I especially cannot get the first line to reorder on first page load and it seems limited that you cannot drop a row at the bottom of the grid?
0
Rosen
Telerik team
answered on 11 Sep 2008, 01:15 PM
Hi Tony Hogben,

You can use the DropPosition property of the RowDrop event's argument object in order to determine if the dragged item should be placed before or after the destination item. And modify the update statement accordingly. You may refer to this Code Library for a possible implementation.

All the best,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
The KID
Top achievements
Rank 2
Answers by
Vlad
Telerik team
The KID
Top achievements
Rank 2
Rosen
Telerik team
Matt
Top achievements
Rank 2
Share this question
or