DataItem OnNodeDrop

2 posts, 0 answers
  1. Neil
    Neil avatar
    50 posts
    Member since:
    Mar 2009

    Posted 27 Jan 2011 Link to this post

    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


  2. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 31 Jan 2011 Link to this post

    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.

    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.
Back to Top