Disable Expand All

3 posts, 0 answers
  1. Graham
    Graham avatar
    2 posts
    Member since:
    Jun 2011

    Posted 26 Nov 2013 Link to this post

    First post here. Have really loved the trial of the Silverlight Controls, so bought the product.

    I'm mainly using the Silverlight Treeview at the moment, the choice being made because of the virtualisation which the Silverlight Toolkit version didn't offer. I have a tree with ~130000 nodes, being semi built on demand, such that the first few levels are loaded straight away and then when a node is expanded, I fetch its grand-children, having already got its children. It means that the user experience is reasonably good.

    One thing I do need to do with that volume of nodes is to prevent the user from Expanding All nodes, by pressing * on the numeric keypad or whatever other methods there are and this is particularly vital when at the top of the tree. Further down, I can live with, but an all or nothing approach is fine.

    What's the best way of achieving this? I am using an MVVM approach, so am guessing an attached behaviour of some kind is needed?

    Many thanks
  2. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 29 Nov 2013 Link to this post

    Hello Graham,

    We understand your requirement. Currently there is no out of the box way to achieve it. However, you can inherit the RadTreeView and the RadTreeViewItem and override their OnKeyDown methods like so:
    protected override void OnKeyDown(KeyEventArgs e)
               if (e.Key == Key.Multiply)
    You can find this demonstrated in the attached projet. We hope it will help you proceed further.

    Petar Mladenov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Graham
    Graham avatar
    2 posts
    Member since:
    Jun 2011

    Posted 02 Dec 2013 Link to this post

    Hi Petar

    Many thanks for this. It has solved my immediate need.

    Kind Regards
Back to Top