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

[Solved] Drag And Drop onRowDropping

2 Answers 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Felipe Saldana
Top achievements
Rank 1
Felipe Saldana asked on 14 Aug 2009, 12:47 AM
I have read over the existing documentation and searched in the forums but I cannot seem to find a solution

I have a RadGrid that is using the "GroupBy" functionality. I just want to drag and drop a grid item from one group to another.

I capture the OnRowDropping event and this is working fine.
Inside this event I want to retrieve the corresponding DataKey value from the underlying grid so that I can perform a look up and verify that the dragged row is going into a different group.

Does anyone know how to retrieve the DataKey value from the underlying grid for both the target and the dragged item?

I have tried this
http://www.telerik.com/help/aspnet-ajax/grdextractkeyvaluesclientside.html



                    var targetIndex = args.get_targetItemIndexHierarchical(); 
 
                    var targetListingId = $find("ctl00_contentMember_subscriberList_gridList_ctl00").get_dataItems()[targetIndex]; 
 

but targetListingId.getDataKeyValue("subscriberListId") is null.


Any help is appreciated.

Felipe




2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 18 Aug 2009, 01:15 PM
Hello Felipe,

May I suggest you set the ClientDataKeyNames collection in the corresponding table view? For more information you can refer to this online help article.

Regards, Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Felipe Saldana
Top achievements
Rank 1
answered on 19 Aug 2009, 11:05 PM
Thank you.

I did need to set the set the ClientDataKeyNames collection .

Also, I did this

                if (args.get_targetGridDataItem()) { 
 
                    var targetId = args.get_targetGridDataItem().getDataKeyValue("myKeyName"); 
 


Thanks!
Tags
Grid
Asked by
Felipe Saldana
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Felipe Saldana
Top achievements
Rank 1
Share this question
or