RadTreeView for ASP.NET

Expanding tree nodes on single click Send comments on this topic.
See Also
Example scenarios (How to) > Client -side > Expanding tree nodes on single click

Glossary Item Box

Goal: Expand tree nodes on single click.

By default, Telerik RadTreeView expands a node only upon double click. You can change this behavior for all nodes (or only for specific nodes) by:

  1. Hooking the client-side event BeforeClientClick
  2. In the event handler you can check if the node belongs to a specific group of nodes (by checking its Text or Category property for example) and force expand event on single click.

Example:

ASPX Copy Code
<script language="javascript">

   
function ClickHandler(node)
   {
       if ((node.Text =="Service" || node.Text == "Research")
&& node.Nodes.length > 0)
       {
            node.Toggle();
       }
   }

</script>

...
<rad:radtreeview runat="server" BeforeClientClick="ClickHandler" ... />
...
        

 

See Also