get element id in NodeTemplate

2 posts, 0 answers
  1. roy
    roy avatar
    3 posts
    Member since:
    Feb 2011

    Posted 12 Feb 2011 Link to this post

    hello everyone
     how can i get an element id(in this case a div tag) inside a NodeTemplate.
    my aproach doesnt work , what should i do?

    <
    telerik:RadTreeView runat="server" ID="RadTreeView1" Skin="Vista">
        <NodeTemplate>
                
    <div runat="server" onclick="ExpandDiv('<%=div_expand.CliendID %>')">
                    <div runat="server" id="div_expand">
                    </div>
                
    </div>
        </NodeTemplate>        
        <
    Nodes>
                ..... from database
        </Nodes>
    </telerik:RadTreeView>

    in js:
    function ExpandDiv(id) {
        var div = document.getElementById(id);
    }

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Feb 2011 Link to this post

    Hello Roy,

    Here I found a documentation regarding how to access control in NodeTemplate. Please go through this to achieve the required.
    Accessing Controls Inside Templates


    Thanks,
    Princy.
Back to Top