DataItem in Databound Treeview

3 posts, 1 answers
  1. Viktor Takacs
    Viktor Takacs avatar
    95 posts
    Member since:
    Mar 2006

    Posted 08 Jul 2011 Link to this post

    Hi,
    Is there a way to retrieve the dataitem of  the clicked node in a databound treeview? In the NodeClick event the e.Node.DataItem is null. I can only get the text.
    Thanks for any ideas!
    v
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2011 Link to this post

    Hello Viktor,

    The DataItem property is available only during databinding in the NodeDataBound event. You cannotnot use it elsewhere. You can use the Value property or Custom Attributes instead.

    Thanks,
    Shinu.
  3. Viktor Takacs
    Viktor Takacs avatar
    95 posts
    Member since:
    Mar 2006

    Posted 11 Jul 2011 Link to this post

    Hi Shinu,

    Thanks for the reply. I see now that I can use a custom attribute to hold an id of some sort.

    Thanks!
    viktor
Back to Top