All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX Forum
/
TreeView
/
Detect key down on NodeExpand?
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
3 posts, 0 answers
Jeppe
12 posts
Member since:
Jan 2009
Posted 07 Sep 2009
Link to this post
Hi
I would like to detect a key down when i press a node expand in my tree view. In this way I can decide to expand all nodes on a tree if for example the Shift key is hold down why pressing the expand.
Jeppe
Shinu
17764 posts
Member since:
Mar 2007
Posted 08 Sep 2009
Link to this post
Hi Jeppe,
Checkout the following client side code which shows how to check whether Shift key is pressed when expanding the node using keyboard.
javascript:
<script type=
"text/javascript"
>
function
OnClientNodeExpanding(sender, args)
{
alert(
'KeyCode is :'
+
args.get_domEvent().keyCode
);
if
(
args.get_domEvent().shiftKey
)
{
alert(
"shiftKey is pressed"
);
}
}
</script>
-Shinu.
Jeppe
12 posts
Member since:
Jan 2009
Posted 08 Sep 2009
Link to this post
Thanks for the answer.
I am not sure how I can use that server side to call a ExpandAllNodes function?
Anyway I solved it by adding a context menu item to the nodes instead. So to expand only current node press the the +, else right click and expand all.
Back to Top
Close