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

Drag Drop row to empty grid

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 14 Dec 2011, 11:26 PM
I have multiple grids, and the user can drag and drop rows from one to another.  I am making use of OnRowDropping to call webservices, trigger rebinds, etc.  All is working perfectly....  except when the user drops a row from one grid on to an empty grid containing only the NoRecordsTemplate.  The event is raised, but the "args" object contains null for all the "target" values....  i.e.

 

_targetItemTableView, etc.   The destinationHtmlElement is populated, so I use this to navigate backwards to find the Grid, but the lack of "target" info in this situation seems to be a bug to me.

Dave

2 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 19 Dec 2011, 03:52 PM
Hi Dave,

Your scenario is expected behavior. targetGridDataItem, targetItemDataKeyValues, targetItemId, targetItemIndexHierarchical, targetItemTableView and targetRadGrid represent the item which is related to the dropped item. This could be either the above or below item, the dropPosition property holds that information. When first dragging an item in the grid there are no items and respectively no target to relate to. You could try and find the grid by using the JavaScript below.

 

$find("<%= RadGrid1.ClientID %>");

 

Regards,
Antonio Stoilkov
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
Dave
Top achievements
Rank 1
answered on 19 Dec 2011, 09:44 PM
Hi Antonio,

Thank you for your response, and now I know the expected behavior.  The option you suggest works for a declarative environment, but in my situation grids are created dynamically by users.   By setting an attribute on the grid server side, and then accessing the DOM element on the client, I'm able to navigate up and find the grid that way.   Seems to be the only option.

Thanks!
Dave
Tags
Grid
Asked by
Dave
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Dave
Top achievements
Rank 1
Share this question
or