Context Aware RadTreeView RadTreeViewContextMenu

2 posts, 0 answers
  1. Zed
    Zed avatar
    74 posts
    Member since:
    Apr 2008

    Posted 16 Oct 2013 Link to this post

       Depending on what node the user clicks, I would like to disable/hide a certain RadMenuItem. 
    I found this
    but need to find out if a node has siblings.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Oct 2013 Link to this post

    Hi Zed,

    Please try the following code snippet that I tried to access the siblings node of a RadTreeView node on OnClientNodeClicked event.

    <telerik:RadTreeView ID="RadTreeView" runat="server" OnClientNodeClicked="OnClientNodeClicked1">
            <telerik:RadTreeNode Text="First" runat="server">
            <telerik:RadTreeNode Text="Second" runat="server">
            <telerik:RadTreeNode Text="Third" runat="server">

    <script type="text/javascript">
        function OnClientNodeClicked1(sender, args) {
            if (args.get_node().get_isLast() == false)
                alert("Next :" + args.get_node().get_nextSibling().get_text());
            if (args.get_node().get_isFirst() == false)
                alert("Previous :" + args.get_node().get_previousSibling().get_text());
  3. DevCraft R3 2016 release webinar banner
Back to Top