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

[Solved] tree.get_SelectedNodes() method is giving nodes in different order

3 Answers 140 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
animesh misra
Top achievements
Rank 1
animesh misra asked on 11 Feb 2010, 12:08 PM

Hi,

I found one strange problem while working with TreeView control.

In my project I wrote a functionality to select multiple nodes by holding Shift key.

The functionality is working fine, but when I use tree.get_SelectedNodes() method, it  gives me all the selected members but the order  

of these nodes is different  from what we can see in tree.

Please let me know, how to get the selected nodes in correct order.

Thanks in Advance,
Animesh Misra

3 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 12 Feb 2010, 03:11 PM
How exactly is the order of the nodes different? Are you selecting the nodes in a certain way and then want the selected nodes collection to be ordered in the same way as they were selected? Or are you looking to have them sorted from top to bottom yet they're in the order of selection?
0
animesh misra
Top achievements
Rank 1
answered on 15 Feb 2010, 05:44 AM
The functionality is like this
Assume : there are ten nodes
1. Select node 3
2. Hold shift key and select node 9
3. Now the logic that i wrote selects all the nodes from 3 to 9

And I am expecting get_SelectedNodes to return all the nodes in correct order which is 3,4,5,6,7,8,9
But it is returning me 3,9,4,5,6,7,8
0
Yana
Telerik team
answered on 15 Feb 2010, 03:25 PM
Hi Animesh,

The nodes in the array returned by get_selectedNodes() method are ordered in the way that they are selected.

All the best,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
animesh misra
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
animesh misra
Top achievements
Rank 1
Yana
Telerik team
Share this question
or