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

RadGrid With Filter and Drag Drop Rows

4 Answers 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 22 Aug 2012, 03:26 PM
hi

i wonder if you can help

i have set up a radgrid with the google style filtering as explained here google like filter

and i have combined it with drag and drop rows like here http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx

fyi i have both grids in a RadAjaxPanel which seems ok as ive tried it with and without it.

the problem i am having is that when i apply a filter and then drag one of the filtered rows to the new grid the actual item that turns up in the

e.DraggedItems collection of RadGrid1_RowDrop(object sender, GridDragDropEventArgs e) event is the wrong one.

if you imagine the grid as the following items
a b
1 1
1 2
2 1
2 2

and i filter on b = 2 i only see
a b
1 2
2 2

and then i select 2 2 to drag and drop , the recieving grid actually gets 1 2 , this is because the source grid has lost its filter at some point during the drag and drop process.

i hope this makes sense , and i am hoping someone can help.

thanks alot in advance.

Peter

 

4 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 27 Aug 2012, 01:40 PM
Hi Peter,

It is very odd that this happens, because inside the grdShippedOrders_RowDrop the GetOrder that is used access draggedItem.GetDataKeyValue("OrderId") that is the OrderID from the record in the database. If you follow exact the same logic as in the demo, it should work in your case.
Can you place a breakpoint inside grdShippedOrders_RowDrop and debug the code to see what exectly is the item that GetOrder returns?
If e.DraggedItems returns wrong items, then the problem can be actually in our code, can you test and confirm?

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Kyle
Top achievements
Rank 1
answered on 15 Feb 2013, 05:48 PM
I realize this is an old topic but I'm experiencing something similar.  In my example e.draggeditems contains the items as they were before grid B was filtered.  This only happens the first time I attempt to drag from B to A.  The second time I drag from B to A it works as intended.  But each time right after I filter grid B my first drag attempt fails.  Hope this helps.
0
Vasil
Telerik team
answered on 19 Feb 2013, 12:46 PM
Hi,

I have tested this enabling the filtering in this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx
Then I have placed break point on this line:
Order tmpOrder = GetOrder(pendingOrders, (int)draggedItem.GetDataKeyValue("OrderId"));
On initial load the first item is: 10248.
I have typed 10253 in the filter of the ID column and choose EqualTo.
Now the breakpoints hits and the (int)draggedItem.GetDataKeyValue("OrderId") seems to be the correct ID 10253.
I would expect to see 10248 if i had the same problem as you, but in my case I got 10253 and it is working correct.

I am not sure why you are facing the problem, but it should be caused by something else in your configurations. If you insulate the problem in sample runnable page and sent it to use we will perform further debugging here.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Peter
Top achievements
Rank 1
answered on 19 Feb 2013, 12:53 PM
hi there

i should have closed this off i found the solution.

the issue was due to dynamic data and when things where being processed , i.e page_load vs page_init , once that was resolved it worked fine and i was able to get everything i wanted working.

Peter
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Kyle
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Share this question
or