expand parent level row to show second level row

6 posts, 0 answers
  1. Christopher
    Christopher avatar
    12 posts
    Member since:
    Jul 2008

    Posted 25 Aug 2010 Link to this post

    Thanks for the new TreeListView control. By default the TreeListView loads my collection of data only showing the parent level.  The children levels are collapsed on the grid.  I was wondering if its possible to expand to show the second level rows of my hierarchy data by default.  I don't see anywhere to do this in the API.  Please help.

    Thanks
  2. Christopher
    Christopher avatar
    12 posts
    Member since:
    Jul 2008

    Posted 25 Aug 2010 Link to this post

    Never mind. I did the following and I got the second hierarchy level to expand--

    RadTreeListView1.ExpandHierarchyItem(

     

    this.RadTreeListView1.Items[0]);

     



    Is there a way to do this declaratively in xaml?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 26 Aug 2010 Link to this post

    Hello Christopher,

    Currently this is the preferred way of expanding items. We are considering to properties that will allow you to easily expand all items.


    All the best,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Corey
    Corey avatar
    6 posts
    Member since:
    Nov 2010

    Posted 02 Nov 2010 Link to this post

    Any progress on this? Having to iterate the ItemsCollection, etc to save/restore the state of a tree view isn't ideally how this should be done in WPF.

    Thanks,

    Corey
  6. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 08 Nov 2010 Link to this post

    Hi Corey,

    I am afraid that there is not improvement on the matter. You might want to create a feature request using our Public Issue Tracking System so that other users can vote for this feature and boost its priority by doing so.


    All the best,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Sharada
    Sharada avatar
    43 posts
    Member since:
    Mar 2009

    Posted 03 Jan 2011 Link to this post

     Please try out this. This will expand the upto level 1.

    Add below Event 
     
    RadTreeListView1.ItemContainerGenerator.StatusChanged += new EventHandler(ItemContainerGenerator_StatusChanged);

     

     

    void

     

     

    ItemContainerGenerator_StatusChanged(object sender, EventArgs e) {
    if (RadTreeListView1.ItemContainerGenerator.Status == System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated)
    {

     

     

     

     

    if (RadTreeListView1.Items != null && RadTreeListView1.Items.Count > 0)

     

     

    {

     

    for (int i = 0; i < RadTreeListView1.Items.Count; i++)

     

     

    {

     

     

    TreeListViewRow objRow = (TreeListViewRow)RadTreeListView1.ItemContainerGenerator.ContainerFromIndex(i);

     if (objRow != null && !objRow.IsExpanded)

     

     

    {

     

     

     

    if (objRow.Level == 0 || objRow.Level == 1) 
     objRow.IsExpanded =
    true; }

     

     

    }

    }

    }
    }

     

     

     

Back to Top
UI for WPF is Visual Studio 2017 Ready