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

MultiSelect with LeftClick

3 Answers 68 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
scorp
Top achievements
Rank 1
scorp asked on 04 Mar 2011, 05:29 PM
I have the treeview's selection mode to MultiSelect. However I want the the treeview items to be mutilselected on LeftClick. How can I achieve this?
Thanks.

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Mar 2011, 10:10 AM
Hello scorp,

Currently m the multiple Selection mode is not implemented in the RadTreeView out of the box. This mode actually makes the tree behave the same as it does in the Extended Selection mode. So you have to implement your own multiple selection logic using the Click events of the RadTreeView. You can also vote for this issue in our PITS and this way increase its priority.

Regards,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
scorp
Top achievements
Rank 1
answered on 09 Mar 2011, 07:57 PM
Thanks. How do I figure out the most recent checked radtreeviewitem on the checked event.
I know there is a CheckedItems collection for the treeview but how do I figure out which item was the last checked item(or inserted into the collection). When I do a for loop on the collection the item is not inserted in the end of the collection either when I uncheck a few in the treeview and then check an item again.
0
Petar Mladenov
Telerik team
answered on 14 Mar 2011, 01:14 PM
Hi scorp,

Since Q1 2010, the CheckedItems collection is not an ObservableCollection but a read only HashSet that the tree uses internally for many optimizations. You shouldn't use it to get the first or the last checked item.
It also contains both RadTreeViewItems and the business objects inside them. The CheckedItems also doesn't remove an item immediately after you uncheck it. So it is better to avoid using it. Instead, you can bind the IsChecked property of the RadTreeViewitem to a boolean property of your ViewModel using ContainerBindings. You can also have properties in your tree`s ViewModel that hold the first Checked item or last Checked item and set/unset(reset) them via the Checked/UnChecked event handler of the RadTreeView.
Hope this info helps you. Feel free to ask if you need further assistance.

Greetings,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeView
Asked by
scorp
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
scorp
Top achievements
Rank 1
Share this question
or