Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Hide expansion arrows on rows with no children ?

$
0
0

In my scenario I wanted all items that are indented (children one level down from group headers) to not be expandable, because they will never have children. Thus, after a bunch of Googling, and cobbling together a couple of bits from different sources, this works:

 

XAML:

<telerik:RadTreeListView  RowLoaded="ProjectsTreeView_RowLoaded" etc. />

 

C#:

        private void ProjectsTreeView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            try
            {
                var row = (e.Row as Telerik.Windows.Controls.GridView.GridViewRow);
                if (row != null && row.IndentLevel > 0)
                {
                    row.IsExpandable = false;
                }
            }
            catch { }
        }


Viewing all articles
Browse latest Browse all 84751

Trending Articles