How to get Attribute "DataFieldID"?

3 posts, 0 answers
  1. BiBongNet
    BiBongNet avatar
    27 posts
    Member since:
    May 2010

    Posted 05 Oct 2012 Link to this post

    I have a TreeView like this:

    <telerik:RadTreeView ID="TreeView" runat="server" DataTextField="Title" DataFieldID="CategoryID" DataValueField="ContentTypeID" DataFieldParentID="ParentID"></telerik:RadTreeView>

    I would like to get the value of CategoryID on client side, so I try to get the attribute of DataFieldID, but can't find a way to.

    I have tried:
    treeNode.get_attributes().getAttribute("DataFieldID");

    but that returns undefined.

    This page http://www.telerik.com/help/aspnet-ajax/treeview-client-objects-radtreenode.html shows many attributes that their value can be retrieved with methods, like:
    get_navigateUrl();
    get_imageUrl();
    get_toolTip();
    ...
    but there is nothing for DataFieldID.

    I CAN get the value of CategoryID by creating a custom attribute ("CategoryIDCustom" for example), then get by treeNode.get_attributes().getAttribute("CategoryIDCustom");
    But I think why do we need to create a custom attribute, while there is ALREADY one for it?

    Now, I am living with the way of creating a custom attribute.

    Is there a different way to get that? or am I missing something? Please help.
    Thank you.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Oct 2012 Link to this post

    Hello,

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

    Hope this helps.

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. BiBongNet
    BiBongNet avatar
    27 posts
    Member since:
    May 2010

    Posted 06 Oct 2012 Link to this post

    Thank you for your reply.
    So, I should be "happy" with my way now.
Back to Top