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

DropdownButton interaction and Treeview issue

1 Answer 52 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Kevin Kutlesa
Top achievements
Rank 1
Kevin Kutlesa asked on 09 Nov 2011, 06:58 PM
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?

Kevin

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 14 Nov 2011, 05:17 PM
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 >>

Tags
Buttons
Asked by
Kevin Kutlesa
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or