Rad Tree view ItemTemplate

2 posts, 0 answers
  1. Ahmad
    Ahmad avatar
    5 posts
    Member since:
    Oct 2010

    Posted 08 Jan 2012 Link to this post

    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.


  2. Petar Mladenov
    Petar Mladenov avatar
    3062 posts

    Posted 11 Jan 2012 Link to this post

    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 >>

Back to Top