Find DataFieldId from RadTreeView through JS

3 posts, 0 answers
  1. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 13 May 2011 Link to this post


    Here I need to find DataFieldId from RadTreeView through javascript. My scenario as under:

    RadTreeView Fillup as:

    RadTreeView1.DataTextField = "ModuleName";
    RadTreeView1.DataFieldID = "ModuleID";
    RadTreeView1.DataValueField = "URL";
    RadTreeView1.DataFieldParentID = "ParentModuleID";
    RadTreeView1.DataSource = lstmenu;

    As above I need DataTextField to display text of my modules, DataValueFields which i am using in JS to pass local url in it. In DatafieldId I am storing "ModuleId". But in javascript I can not find DataFieldId which I need to user on click of RadTreeNode.

    JS as like:

    function onNodeClicking(sender, args) {
        if (args.get_node().get_value() != null) {
            //, args.get_node().get_text(), 'resizable=yes')

    in above js I need to find DataFieldId also. Please assit me how to do this.

    Thanks & Regards,

    Kaushal Jani
  2. Kate
    Kate avatar
    1898 posts

    Posted 18 May 2011 Link to this post

    Hello Kaushal,

    Unfortunately this property can not be used on the client-side since it is used internally by RadTreeView to create a hierarchy. You could however use the Value property of the node. Please take a look at the following forum post where this issue is being fully discussed.

    Best wishes,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 19 May 2011 Link to this post

    Hi Kate,

    Thanks for reply me first of all.
    Here after lot of my searching and finally from your answer I got that this property is not accessible at client side.

    I also found one alternate solution related to it.Here it is:
    I am passing my ModuleId at the time of I am passing value into RadTreeView:

     protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
            e.Node.ToolTip = "MyTootip";
            e.Node.Value = e.Node.Value + "?ModuleID=" + ModuleID.ToString();

    Now I can use this parameter in each page as request querystring. Also I can bind Tooltip here is you want (It also can bind client side).
    Thanks Kate for all of this and for co-operation,

    Kaushal Jani

Back to Top