Well, let me shine a little bit more light on my problem.
Assume that I have the following code:
this.radTreeListView.SelectionChanged += (s, e) =>
if (this.radTreeListView.SelectedItem != null)
var yamlItem = this.radTreeListView.SelectedItem as YamlItem;
if (yamlItem != null && yamlItem.Type != SignalType.Subsystem)
// store selected item into variable
this.storedSelectedItem = this.radTreeListView.SelectedItem;
Let's also assume that when collection of RadTreeListView is going to be changed we have to re-select the last selected item that we stored in local variable this.storedSelectedItem.
this.radTreeListView.Items.CollectionChanged += (s, e) =>
Of course It doesn't works, becouse the old collection was replaced by the new collection, and this.storedSelectedItem has another HashCode, that's why this.radTreeListView.ScrollIntoViewAsync(this.storedSelectedItem, null); can't find such item in its collection.
Well, to solve this issue I would like to foreach throw the all existed items in the this.radTreeListView.Items, and when I find the item that is equals to my stored item this.storedSelectedItem.SomeTextValue (I will compare these items by string value that has each item) and afterwords I call this method this.radTreeListView.ScrollIntoViewAsync(this.storedSelectedItem, null);.
That was my idea how to solve it, but I need your support how to foreach throw the hierarchical data structure of this.radTreeListView.Items.
Maybe you have another solution how to solve it ?
Please need your advice ASAP !