According to the father node, how to make all it's child nodes be checked?

2 posts, 0 answers
  1. Starry
    Starry avatar
    59 posts
    Member since:
    Apr 2012

    Posted 07 Jun 2012 Link to this post

    According to the father  node,   how  to  make   all  it's child nodes  be   checked ?

    “RadTreeViewItem”  has  no  "IsChecked"  Property ,  how  to do ???

    The  code as below:
       
         private void rtv_BuildingList_Checked(object sender, Telerik.Windows.RadRoutedEventArgs e)
            {
                if ((e.Source as RadTreeViewItem).HasItems)
                {
                    foreach (RadTreeViewItem item in (e.Source as RadTreeViewItem).Items)
                    {
                        
                        //item.IsC = true;
                    }
                }
            }
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3151 posts

    Posted 11 Jun 2012 Link to this post

    Hello Starry,

     RadTreeViewItem has both IsChecked and CheckState properties. In all scenarios it is better to work with the CheckState property. This blog post describes their differences.
    As for making child items checked when their parent is checked, you only have to set the IsInTriStateMode = True.

    Regards,
    Petar Mladenov
    the Telerik team

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

Back to Top