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

RadGrid reorder rows

4 Answers 531 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nicolaï
Top achievements
Rank 2
Nicolaï asked on 03 Nov 2015, 05:46 PM

Hello,

 

How would find (and store) the new indexes for every item within a radgrid after multiple rows have been dragged and dropped?

(

This demo does it wrong btw, does not properly re-order rows within one grid in scenarios where you drag multiple rows from different positions:

http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/rows/drag-and-drop/defaultvb.aspx?show-source=true

Attached files illustrate non working demo re-order:  draggedrows.PNG shows 2 rows selected, dropped them between "HANAR" and "CHOPS"; draggedrowsdroppedbetweenhanarandchops.PNG shows result of operation, not expected result. Demo only checks for first dragged item...

)

- How to write out the new indexes client side onrowdropped in a hidden column, so I can get these values on the server side rowdrop event?

- Or How to get new indexes server side after rows are dropped directly?

4 Answers, 1 is accepted

Sort by
0
Nicolaï
Top achievements
Rank 2
answered on 03 Nov 2015, 06:02 PM
(New indexes of every row displayed after drop)
0
Konstantin Dikov
Telerik team
answered on 06 Nov 2015, 11:31 AM
Hello Nicolai,

Detailed information about the Drag & Drop functionality and how to get the data that you are looking for could be found in the following help article:
If you drag multiple items, those items will be available within the server-side OnRowDrop event's argument in the e.DraggedItems collection (with GridDataItem objects).

Hope this helps.


Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nicolaï
Top achievements
Rank 2
answered on 11 Jan 2016, 10:33 AM

Ok. Start over. I'm gonna try to put it simply.

Your demo does not work, because the radgrid reverses the order it reads rows if you drag up.

Step 1; Open http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/rows/drag-and-drop/defaultvb.aspx

(Step 2; Select 2 or more rows, drag down - ok!)

Step 3; Select 2 or more rows, drag UP - BUG! Order reversed!

I've got MY code working now, I'm just letting you know there is a bug, because I'm so nice.

0
Konstantin Dikov
Telerik team
answered on 14 Jan 2016, 10:56 AM
Hi Nicolaï,

Following the steps that you have listed I was able to observe the issue in question. Nevertheless, this is not a bug in the functionality, but rather with the implementation in the demo, so I will forward this for further investigation.

Thank you for sharing your findings with us.


Best Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Nicolaï
Top achievements
Rank 2
Answers by
Nicolaï
Top achievements
Rank 2
Konstantin Dikov
Telerik team
Share this question
or