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
/
client side treeview context menu!
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
4 posts, 1 answers
towpse
224 posts
Member since:
Mar 2008
Posted 24 Apr 2009
Link to this post
Is there a way I can get at a treeview context menu client side outside of any treeview specific events?
on page load i want to grab the treeview context menu and hide some items if necessary.
or do i use a radcontext menu separate from the tree and show that
i'm trying this
Sys.Application.add_load(function() {
//determine if user has permission.
if (!allow('Something')) {
$find('myTelerikToolbar1').findItemByValue('something').hide(); //THIS WORKS!!
$find('tvContext').findItemByValue('something').hide(); //THIS DOESN'T
}
});
regards
towpse
224 posts
Member since:
Mar 2008
Posted 24 Apr 2009
Link to this post
actually $find('myTelerikToolbar1').findItemByValue('something').hide(); does not work!
it doesn't hide the telerik rad toolbar menu item.
Answer
Shinu
17764 posts
Member since:
Mar 2007
Posted 24 Apr 2009
Link to this post
Hello,
I tried following client side code and its working fine in my end. Give a try with following code and see whether it helps.
[aspx]
<
telerik:radtreeview
id
=
"RadTreeView1"
runat
=
"server"
>
<
ContextMenus
>
<
telerik:RadTreeViewContextMenu
ID
=
"tvContext"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Copy"
Value
=
"Copy"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Edit"
Value
=
"Edit"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadTreeViewContextMenu
>
</
ContextMenus
>
<
Nodes
>
. . .
</
Nodes
>
</
telerik:radtreeview
>
[javascript]
<script type=
"text/javascript"
>
Sys.Application.add_load(
function
()
{
//determine if user has permission.
if
(!allow(
'something'
))
{
$find(
"<%= tvContext.ClientID %>"
).findItemByValue(
'Edit'
).hide();
}
});
</script>
Checkout the documentation on RadContextMenu.
RadContextMenu
Thanks,
Shinu.
towpse
224 posts
Member since:
Mar 2008
Posted 27 Apr 2009
Link to this post
thanks, shinu.
Back to Top
Close