Q1 2011 - Equivalent to ExpandLevel

5 posts, 0 answers
  1. MNP
    MNP avatar
    40 posts
    Member since:
    Apr 2008

    Posted 25 Mar 2011 Link to this post

    Updated to Q1 2011 and noticed the ExpandLevel call didn't make it over to the new TreeView. Is there an equivalent, or do I have to write a loop to manually do it?

    If so, can I request the ability to do this come back? 

    Thanks

    -Matt
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 30 Mar 2011 Link to this post

    Hello Matt,

    Thank you for writing.

    You can use the Expand function and provide as an argument the desired tree node collection which you want to be expanded. For the inner levels you will have to loop through the nodes.

    I hope this helps.
     
    Best wishes,
    Stefan
    the Telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ian
    Ian avatar
    61 posts
    Member since:
    Jul 2010

    Posted 30 Mar 2011 Link to this post

    Hi Matt

    I recently needed to achieve node expansion in a way which allowed me to restrct the level in the tree to which expansion would occur. This code works quite nicely:

    private void TreeNodeRecursiveExpansion(RadTreeNodeCollection nodes, int level)
    {
            foreach (RadTreeNode myNode in nodes)
            {
                if (myNode.Level != level)
                {
                    myNode.Expand();
                    TreeNodeRecursiveExpansion(myNode.Nodes, level);
                }
            }
    }


    Regards
    Ian Carson
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 04 Apr 2011 Link to this post

    Hello Ian,

    Thank you for sharing your code with the community.
     
    Best wishes,
    Stefan
    the Telerik team
  6. Ian
    Ian avatar
    61 posts
    Member since:
    Jul 2010

    Posted 05 Apr 2011 Link to this post

    Hi Stefan

    That's my pleasure. You guys are very helpful so just trying to give back a little as well.

    Regards
    Ian
Back to Top
UI for WinForms is Visual Studio 2017 Ready