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

e.DraggedItems.DataItem(0).Row.newRecord not correct

3 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 17 Jun 2014, 01:58 PM
I am using the drag and drop feature of the RadGrid. I am attempting to determine where in the grid I am dragging and dropping a specific row. Say my grid has 4 rows. I attempt to move the first row to the last row. When I go into e.DraggedItems.DataItem(0).Row.newRecord I see that the newRecord number is the same as oldRecord. I also get an error saying that a non-negative number is required for parameter length if I attempt to do something like

If e.DraggedItems.DataItem(0).Row.newRecord = e.DraggedItems.DataItem(0).Row.oldRecord Then
 
End If


I am only attempting to get the first row that is dragged as I have multi drag turned off.

Am I going about getting the dropped location correctly? Or is there a better way?

3 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 17 Jun 2014, 02:00 PM
I messed up the information on here because I didn't copy paste my code.

When i wrote

e.DraggedItems.DataItem(0).Row.newRecord / oldRecord

What I had meant was

e.DraggedItems(0).DataItem.Row.newRecord / oldRecord
0
Alexander
Top achievements
Rank 1
answered on 17 Jun 2014, 02:15 PM
Apparently Row is not an accessible item from the DataItem. I can go in with Visual Studio and see the old/new record and they're still the same nevertheless though.
0
Alexander
Top achievements
Rank 1
answered on 17 Jun 2014, 02:29 PM
I'm just a goofy goofy person. Using e.DestItem.DataSetIndex and e.DraggedItems(0).DataSetIndex I was able to determine the locations of before and after. Sorry for clogging up the forums!
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Share this question
or