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

Selecting TreeList items Dynamically

1 Answer 73 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Tejas Kan
Top achievements
Rank 1
Tejas Kan asked on 04 May 2011, 06:20 AM
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.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 04 May 2011, 02:02 PM
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.

Tags
TreeList
Asked by
Tejas Kan
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or