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

DataItem OnNodeDrop

1 Answer 59 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 27 Jan 2011, 10:08 PM
How do I get the DataItem in a NodeDrop event?

I am trying to get my database Id of the row for the source and destination nodes when I drag and drop a node using:

DataRowView dataSourceRow = (DataRowView)e.SourceDragNode.DataItem;

When I step through my code dataSourceRow  is null

Thanks, 
Neil

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 31 Jan 2011, 04:14 PM
Hello Neil,

It's normal that you get null reference for the DataItem, you could only get it when NodeDataBound event is fired. My suggestion is to bind this IDs to be the values for each node , or if you have already binded data to the node value , you could still bind it to a custom attribute. More information about the custom attributes you could find here.

Greetings,
Dimitar Terziev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
TreeView
Asked by
Neil
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or