This is a migrated thread and some comments may be shown as answers.

Data Context

1 Answer 84 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Radu
Top achievements
Rank 1
Radu asked on 04 Jun 2009, 08:48 AM
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

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 04 Jun 2009, 10:44 AM
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.
Tags
TreeView
Asked by
Radu
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or