SelectedNodes.Clear() Not Clearing the selected nodes

4 posts, 0 answers
  1. Frank
    Frank avatar
    106 posts
    Member since:
    Mar 2012

    Posted 11 Jul 2014 Link to this post

    I have an application and when the user hit a button I want to clear the selected nodes in the treeview.  I have tried SelectedNodes.Clear() but the selects remain.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jul 2014 in reply to Frank Link to this post

    Hi Frank,

    In order to clear the selected node please try the below approach which works fine at my end.

    C#:
    protected void rbtnClearSelection_Click(object sender, EventArgs e)
    {
        foreach (Telerik.Web.UI.RadTreeNode node in rtreeviewTestNodes.Nodes)
        {
            if (node.Selected)
                node.Selected = false;
            if (node.Nodes.Count > 0)
            {
                foreach (Telerik.Web.UI.RadTreeNode subNode in node.Nodes)
                {
                    if (subNode.Selected)
                        subNode.Selected = false;
                }
            }
        }
    }

    Thanks,
    Shinu.
  3. Mark
    Mark avatar
    130 posts
    Member since:
    Oct 2014

    Posted 01 Sep 2020 Link to this post

    Any updates to this?  

     

    Thanks

  4. Vessy
    Admin
    Vessy avatar
    2369 posts

    Posted 04 Sep 2020 Link to this post

    Hi Mark,

    Can you elaborate a bit on the exact issue that you need update for? Have you tried the Shinu's suggestion? Is it working for you?

    Regards,
    Vessy
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top