Attribute of RadTreeView

5 posts, 0 answers
  1. Barry
    Barry avatar
    12 posts
    Member since:
    Sep 2012

    Posted 12 Nov 2008 Link to this post

    Each one of my nodes has an attribute of "NodeType". That all works fine. On the server side, OnNodeClick event, I need to know the value of the "Node Type" attribute of the previously selected node. So I added an attribute to the RadTreeControl and I update that attribute each time the node type changes. It doesn't work. The attribute value of the RadTreeControl is not persistant. The next time a node is clicked the server thinks the attribute value is back to its initial value.

    I can see in the content being generated that the attribute is being passed in the RadTreeView object.
    On the post back, __CALLBACKPARAM  does not include the attribute.

    Can a RadTreeView control have an attribute value? Looks like it can.
    What would I have to do to includ it in the __CALLBACKPARAM.

    Is there some other way to keep track of the last node?

    Thanks!

    Bary




  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Nov 2008 Link to this post

    Hello Barry,

    You should be able to access any attribute of any node in the NodeClick event except when you are using load on demand and the PersistLoadOnDemandNodes property is set to false. Please give us more details about your scenario.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Nov 2008 Link to this post

    Hello Barry,

    You should be able to access any attribute of any node in the NodeClick event except when you are using load on demand and the PersistLoadOnDemandNodes property is set to false. Please give us more details about your scenario.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Barry
    Barry avatar
    12 posts
    Member since:
    Sep 2012

    Posted 13 Nov 2008 Link to this post

    Albert,

    My question is regarding RadTreeView.Attributes[] NOT RadTreeNode.Attributes[]. (RadTreeNodes work fine.)

    I can do this:
    tv_Main.Attributes.Add("Location_id","999");
    or
    tv_Main.Attributes["Location_id"] = 999.

    In the debugger the attribute is added or modified as expected.

    When the content is generated I can see the attribute being sent to the client. (I use HtttpFox in Firefox)

    But on the subsequent postback the attribute is missing.

    Thanks!

    Barry

  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Nov 2008 Link to this post

    Hi Barry,

    I couldn't reproduce this behavior in the current official version of RadTreeView. Find attached a sample project.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top