SourceDragNode always null

8 posts, 0 answers
  1. David Sitton
    David Sitton avatar
    52 posts
    Member since:
    Nov 2004

    Posted 18 Jul 2008 Link to this post

    Hi there.

    I am using the TreeView and trying to implement the drag and drop functionality for reordering. I have setup the NodeDrop event as per the documentation using e.SourceDragNode and e.DestDragNode. The DestDragNode works fine however the SourceDragNode always seems to return null.
    Setup is as follows ...

    ASPX...

    <

    telerik:RadTreeView ID="treeMenu" runat="server" DataTextField="Text" DataValueField="Value"

    AllowNodeEditing="True" EnableDragAndDrop="True" EnableViewState="True"

    EnableDragAndDropBetweenNodes="True" OnNodeDrop="treeMenu_NodeDrop"

    CheckBoxes="True" >

    <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>

    <ExpandAnimation Duration="100"></ExpandAnimation>

    </telerik:RadTreeView>

    C#...

    protected

    void treeMenu_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
    {
    RadTreeNode sourceNode = e.SourceDragNode;
    RadTreeNode destNode = e.DestDragNode;
    RadTreeViewDropPosition dropPosition = e.DropPosition;

    if
    (destNode != null)
    {
        if (sourceNode.TreeView.SelectedNodes.Count <= 1)
            {
                PerformDragAndDrop(dropPosition, sourceNode, destNode);
            }
        else if (sourceNode.TreeView.SelectedNodes.Count > 1)
            {
                foreach (RadTreeNode node in sourceNode.TreeView.SelectedNodes)
                    {
                        PerformDragAndDrop(dropPosition, node, destNode);
                    }
            }
        destNode.Expanded =
    true;
        sourceNode.TreeView.ClearSelectedNodes();
    }
    }

    private

    static void PerformDragAndDrop(RadTreeViewDropPosition dropPosition, RadTreeNode sourceNode, RadTreeNode destNode)
    ...


    Please can someone help me to understand why this is happening???

    many thanks

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 18 Jul 2008 Link to this post

    Hello David Sitton,

    We had a similar bug in an older version of the control. Could you please confirm that you are using the latest official release 2008.1 619?

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Sitton
    David Sitton avatar
    52 posts
    Member since:
    Nov 2004

    Posted 18 Jul 2008 Link to this post

    Hi Albert.

    I have just updated to v619 and it seems to work beautifully!
    Thanks for the advice.

    Dave
  5. john
    john avatar
    5 posts
    Member since:
    Aug 2008

    Posted 21 Aug 2008 Link to this post

    Hi Dave,

    Is this release refering to Q1 or Q2?

    Thank you

    John
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 21 Aug 2008 Link to this post

    Hello john,

    The release 2008.1.619 refers to Q1 2008 SP2.


    All the best,
    Veskoni
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. john
    john avatar
    5 posts
    Member since:
    Aug 2008

    Posted 21 Aug 2008 Link to this post

    Hi Veskoni,

    Thanks so much.

    John
  8. bradhh
    bradhh avatar
    25 posts
    Member since:
    Feb 2007

    Posted 27 Feb 2009 Link to this post

    I'm now having the same problem using version 2008.3.1417.35. This code worked before I upgraded (back when I was using Q2 2008). The only change I've made is upgrading to the latest version. I orignally upgraded to Q3 2008, but since I couldn't paste into a multiline text box I had to upgrade to the latest "untested" version. Now I find that I can't drag nodes in RadTreeView.

    Any help would be appreciated!

    Thanks -
    Brad Harris
  9. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 02 Mar 2009 Link to this post

    Hi bradhh,

    We have released the Q1 2009 Beta version. Can you please try with it? I could not reproduce the problem on our online demos.

    I suggest that you open a new support ticket and send us a sample project demonstrating the problem.

    Thanks

    Greetings,
    Veselin Vasilev
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017