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

Hide expansion arrows on rows with no children ?

1 Answer 86 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 17 Jun 2016, 06:44 PM

Hide expansion arrows on rows with no children ?

I have indented child rows that have no children under them, but still have the arrows - they expand into nothing.

How can I hide them ?

Thanks,

Barry

1 Answer, 1 is accepted

Sort by
0
Barry
Top achievements
Rank 1
answered on 17 Jun 2016, 07:07 PM

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 { }
        }

Tags
TreeListView
Asked by
Barry
Top achievements
Rank 1
Answers by
Barry
Top achievements
Rank 1
Share this question
or