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

[Solved] Gat Parent and Children checked

1 Answer 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jose
Top achievements
Rank 1
jose asked on 22 Feb 2011, 11:41 PM
I am working in the RadTreeView control with each element as Checkbox. Each element has children, too type checkebox. When I select a parent who is not expanded, I can not see the children that this has. The selection of the parent automatically generates the selection of the children. Each control element is the type RadTreeview RadTreeViewItems.

What I can do to see the children of each element if like to know what each child belongs to father, I mean the node of each element?

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 25 Feb 2011, 06:02 PM
Hi jose,

First of all, it is important whether your treeview is bound to collection of objects or it is declaratively populated (from xaml). When the tree is not bound, you can get the currently selected item`s children like so:
(this.treeView.SelectedItem as RadTreeViewItem).Items
which is equivalent to
this.treeView.SelectedContainer.Items
When your treeView is bound to collection of objects you can access the currently selected business object  children collection with:
(this.treeView.SelectedItem as BusinessItem).Children as ObservableCollection<Businessitem>
(Supposing that your business object`s class is named Businessitem and it exposes a collection of Businessitems named Children and you bind your tree with ObservableCollection).
However, if this is not what you had in mind, could you please send us a runnable sample showing the issue and we could investigate in depth and advice you better.


Best wishes,
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
GridView
Asked by
jose
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or