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
/
Limited max count when checking the checkbox
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
2 posts, 1 answers
Tommy
10 posts
Member since:
Dec 2008
Posted 17 Mar 2009
Link to this post
Hi Team,
I have set the checkbox value is true also can checked succeed,but I want to limit the max checked count in my treeview.
Can you give me a hand? thank .
Answer
Shinu
17764 posts
Member since:
Mar 2007
Posted 17 Mar 2009
Link to this post
Hello Tommy,
I guess you want to cancel the TreeNode checking if a particular count reached. If that the case, you can try the following client side code. Attach function to the OnClientNodeChecking event of RadTreeView.
JavaScript:
<script type=
"text/javascript"
>
function
OnClientNodeChecking(sender, args)
{
var
tree = $find(
"<%= RadTreeView1.ClientID %>"
);
var
checkedNodes = tree.get_checkedNodes();
if
(!args.get_node().get_checked())
{
if
((checkedNodes.length)>2)
{
alert (
"Max limit reached, Cannot check the node"
);
args.set_cancel(
true
);
}
}
}
</script>
Thanks,
Shinu.
Back to Top
Close