DropdownButton interaction and Treeview issue

2 posts, 0 answers
  1. Kevin Kutlesa
    Kevin Kutlesa avatar
    13 posts
    Member since:
    Aug 2009

    Posted 09 Nov 2011 Link to this post

    Good day to all,

    For a project I'm working on I've got 3 treeviews with checkbox items, each inside a different dropdownbutton, acting as filters for my data. Once the user makes his selections he'll press a button that will apply the filters. Each Tree has a root node, to allow the user to select all items.

    Now, I've got a small problem, if the user doesn't interact with the dropdownbuttons, let's say he just presses the button without even clicking on any dropdown, then, in codebehind the treeviews' checkeditem collection will be null. I've tried working around it in many ways but haven't found a solution...

    At first I had them all in comboboxes, I changed to dropdownbuttons thinking it would solve the situation, but it remains. If the user expands the dropdown, even if he doesn't interact with the treeview itself,then the checkditem collection will contain the items.

    Is there something i can do to fix this?

  2. Petar Mladenov
    Petar Mladenov avatar
    2992 posts

    Posted 14 Nov 2011 Link to this post

    Hello Kevin Kutlesa,

     This is expected behavior of the RadTreeView. It loads its items when they are root level items and they are in a "viewable" area of the application or when they are non-root and their parent is expanded.  In your case, if the RadDropDownButton is not expanded, the Items are not loaded and the CheckedItems collection is empty. 
    As a workaround, I suggest you to use databinding and implement your own CheckedItems collection in your ViewModels. As a good starting point, you can check out this project demonstrating how to implement your own "tri-state" logic in the ViewModels.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top