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

Disable Expand/Collapse Client Side

2 Answers 135 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 30 Jul 2008, 08:05 AM
Hi,

I am populating my TreeView using TreeNodeExplandMode.WebService, which works fine. But when i populate a node that dosen't have any childnode i would like to disable Expand/Collapse, so the expand icon dosen't appear.

How do i achieve this? Should this be done on the RadTreeNodeData object or should i do this Client Side?

Best Regards,
Christian

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 30 Jul 2008, 08:24 AM
Hi Christian,

If you don't set the ExpandMode property of the RadTreeNodeData object the node will not display the expand icon. Here is an excerpt from your web service example
        foreach (DataRow row in productCategories.Rows)
        {
            RadTreeNodeData itemData = new RadTreeNodeData();
            itemData.Text = row["Title"].ToString();
            itemData.Value = row["CategoryId"].ToString();

            if (Convert.ToInt32(row["ChildrenCount"]) > 0)
            {
                itemData.ExpandMode = TreeNodeExpandMode.WebService;
            }

            result.Add(itemData);
        }

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Christian
Top achievements
Rank 1
answered on 30 Jul 2008, 08:32 AM
Hi Albert,

Thanks for your fast response!

Best Regards,
Christian
Tags
TreeView
Asked by
Christian
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Christian
Top achievements
Rank 1
Share this question
or