help in radcombobox

2 posts, 1 answers
  1. Alan
    Alan avatar
    10 posts
    Member since:
    May 2012

    Posted 22 Jun 2012 Link to this post

    I have a radcombobox and radtreeview. When I select an item in a radcombobox I need to remove all nodes in the treeview which has the value same as that of combobox item.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jun 2012 Link to this post

    Hi Alan,

    Try the following Javascript to achieve your scenario.

    JS:
    <script type="text/javascript">
     function OnClientSelectedIndexChanged(sender, args)
       {
          var tree = $find("<%=RadTreeView1.ClientID %>");
          var nodes = tree.get_allNodes();
          for (var i = 0; i < nodes.length; i++)
          {
             if (args.get_item().get_value() == nodes[i].get_value())
             {
                nodes[i].set_visible(false);
             }
          }
       }
    </script>

    Hope this helps.

    Thanks,
    Princy.
Back to Top