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

SourceDragNode always null

7 Answers 101 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David Sitton
Top achievements
Rank 1
David Sitton asked on 18 Jul 2008, 10:37 AM

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

7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Jul 2008, 10:50 AM
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
0
David Sitton
Top achievements
Rank 1
answered on 18 Jul 2008, 12:01 PM
Hi Albert.

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

Dave
0
john
Top achievements
Rank 1
answered on 21 Aug 2008, 08:16 AM
Hi Dave,

Is this release refering to Q1 or Q2?

Thank you

John
0
Veselin Vasilev
Telerik team
answered on 21 Aug 2008, 08:26 AM
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.
0
john
Top achievements
Rank 1
answered on 21 Aug 2008, 08:38 AM
Hi Veskoni,

Thanks so much.

John
0
bradhh
Top achievements
Rank 2
answered on 27 Feb 2009, 07:18 PM
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
0
Veselin Vasilev
Telerik team
answered on 02 Mar 2009, 08:21 AM
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.
Tags
TreeView
Asked by
David Sitton
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
David Sitton
Top achievements
Rank 1
john
Top achievements
Rank 1
Veselin Vasilev
Telerik team
bradhh
Top achievements
Rank 2
Share this question
or