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

Rad Tree view ItemTemplate

1 Answer 133 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ahmad
Top achievements
Rank 1
Ahmad asked on 08 Jan 2012, 02:01 PM
i had an wpf application contains radtreeview ,i add HierarchicalDataTemplate inside RadTreeview Item Template which contains:

1- RadComboBox 
2- grid contains three textboxs and radcombobox.

when radcomobox selectionchanged the grid bind data into textboxes  according to the selected value in the combobox.

how i can return the current row when RadComboBox is changed, and how i get the contorls inside the row as well.

Regards 


1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 11 Jan 2012, 01:42 PM
Hi Ahmad,

 In a good MVVM design, you will be able to detect the current RadTreeViewItem (the selected one), current Row in a GridView, current item that is in edit Mode and etc. So I suggest you work with ViewModels only - bind the controls in the Template to a properties in your ViewModels and change only the ViewModels.
However, if you need to access a control down or up in the Visual tree you can use the Telerik's extension methods ParentOfType<>, or ChildrenOfType<>. Two things are important here- Popups( the DropDownContent of a DropDownButton is usually a Popup) are in a different Visual Trees than the other controls so ParentOfType often cannot be used with them. On the other hand, these two methods are potentially slow - so you better avoid them.

Kind regards,
Petar Mladenov
the Telerik team

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

Tags
TreeView
Asked by
Ahmad
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or