Data Context

2 posts, 0 answers
  1. Radu
    Radu avatar
    4 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2009 Link to this post

    Hi. I would like to know if there is a way I can disable the DataContext property of a TreeViewItem so it will not fire for changes. I am not using DataBinding and I would like to use that DataContext just for keeping the object I am displaying to the user. Or maybe there is another way I can keep an object in the treeViewItem. Thanks
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 04 Jun 2009 Link to this post

    Hello Radu,

    You can use the Tag property, available on all controls for general-purpose storage. It is recommended that you use this property only if there is no more acceptable way of using the controls.

    You can also assign your object as the Header of the TreeViewItem and use a HeaderTemplate to display the contents properly.

    Of course, it is best to use DataBinding but unfortunately it may not always be applicable.

    Best wishes,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top