After much reading I can select TreeViewItem from code behind, JustinAngel's Extension methods works great for me, but now I need to use custom equality logic, any idea how I can find a TreeViewItem with custom equality logic?
4 Answers, 1 is accepted
I guess we will need some additional information in order to advice you correctly.
What exactly do you need to achieve with the RadTreeView? It already has ItemContainerGenerator property and you can use its ContainerFromIndex, ContainerFromItem, ContainerFromItemRecursive methods.
On the other hand, you are able to access a particular RadTreeViewItem with the GetItemByPath method described in this article.
You mentioned that you need a custom equality logic. Are you actually trying to avoid a known selection issue in the RadTreeView - please check out this item ?
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thanks for the response.
What I was hoping for is an IEqualityComparer<T> in the methods like ContainerFromItem, I use wrapper classes and would like equality to be based on one of the attributes of the data context of Node. This is also inline with most of the Linq statements like Distinct etc.
You could override the equals method in your view models in order to override the default comparison logic provided by the framework.
Please let us know if we have missed some details around your scenario and the proposed solution is not applicable.
Hristo
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.