Selecting TreeList items Dynamically

2 posts, 0 answers
  1. Tejas Kan
    Tejas Kan avatar
    6 posts
    Member since:
    Oct 2009

    Posted 04 May 2011 Link to this post

    Hi ,
    I was tring to select TreeListDataItem dynamically using the following code.

    foreach (TreeListDataItem item in RadTreeList1.Items)
                    {
                        if (value != null && value.Count > 0)
                        {
                            foreach (Facility facility in value.Facility)
                            {
                                if (item["Key"].Text == facility.Key)
                                {
                                    item.Selected = true;
                                    break;
                                }
                            }
                        }
                    }

    However what I found that the only the parent items can be selected.
    I am not able to select any of the child or sub child items.
    Please advice what the best way to select any child items if they need to be selected.

    Thanks in advance.

  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 04 May 2011 Link to this post

    Hello Tejas,

    The RadTreeList.Items collection contains visible items only. This means if your child items are not shown (their parents are not expanded) they are also not initialized. You can select visible items only.

    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top