MultiSelect with LeftClick

4 posts, 0 answers
  1. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 04 Mar 2011 Link to this post

    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.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Mar 2011 Link to this post

    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!
  3. DevCraft banner
  4. scorp
    scorp avatar
    59 posts
    Member since:
    Dec 2010

    Posted 09 Mar 2011 Link to this post

    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.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 14 Mar 2011 Link to this post

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