Hi,
I'm experiencing now the trial version of Telerik.Windows.Controls DLL V2011, in order to decide whether to upgrade from V2009,
and unfortunately encountered several problems which I'll appreciate your help solving them.
1. Can't select nodes in the hierarchical tree from code behind if the node isn't in the view,
Because the TreeViewItem is null after trying getting it from the ItemContainerGenerator:
I'm experiencing now the trial version of Telerik.Windows.Controls DLL V2011, in order to decide whether to upgrade from V2009,
and unfortunately encountered several problems which I'll appreciate your help solving them.
1. Can't select nodes in the hierarchical tree from code behind if the node isn't in the view,
Because the TreeViewItem is null after trying getting it from the ItemContainerGenerator:
var treeItem = (RadTreeViewItem)control.ItemContainerGenerator.ContainerFromItem(myVMObject);And I'm using virtualizing
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
2. When sometimes the TreeViewItem is not null, then trying to bring it into view, the previous code no longer works.
ItemsControl control = treeView; control.UpdateLayout(); var treeItem = (RadTreeViewItem)control.ItemContainerGenerator.ContainerFromItem(myVMObject); if (treeItem != null) { treeItem.Focus(); treeItem.IsSelected = true; treeItem.IsExpanded = true;
}
3. By clicking on a node and then switching to other node,
sometimes the last clicked node, even that is selected, not visualy looks like selected,
and the previous one looks like it still selected.
Thanks in advance,
Merav