Hide expansion arrows on rows with no children ?

2 posts, 0 answers
  1. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 17 Jun Link to this post

    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

  2. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 17 Jun Link to this post

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

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top