Recently, when we enabled UI virtualization for RadTreeView in our application, our icons for the RadTreeViewItems disappeared.
We set the icons (DefaultImageSrc) in DataTrigger setters in a style, as follows:
<
UserControl
...>
<
UserControl.Resources
>
<
Style
x:Key
=
"TreeViewItemStyleBase"
TargetType
=
"{x:Type telerik:RadTreeViewItem}"
>
...
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding ...}"
>
<
DataTrigger.Value
>...</
DataTrigger.Value
>
<
Setter
Property
=
"DefaultImageSrc"
Value
=
"/Our App;component/Resources/Icons/grid.png"
/>
</
DataTrigger
>
<
DataTrigger
Binding
=
"{Binding ...}"
>
<
DataTrigger.Value
>
...<
/
DataTrigger.Value
>
<
Setter
Property
=
"DefaultImageSrc"
Value
=
"/Our App;component/Resources/Icons/bargraph.png"
/>
</
DataTrigger
>
</
Style.Triggers
>
</
Style
>
<Style TargetType=
"{x:Type telerik:RadTreeViewItem}"
BasedOn=
"{StaticResource TreeViewItemStyleBase}"
/>
</UserControl.Resources>
<telerik:RadTreeView
IsVirtualizing=
"True"
telerik:TreeViewPanel.VirtualizationMode=
"Hierarchical"
... >
...
</telerik:RadTreeView>
</UserControl>
This is with UI for WPF v. 2015.2.0401
It looks like this is the known bug described here and here. That is, the problem is that DefaultImageSrc is non-functional in virtualized trees.
1) Can I get a confirmation that this bug is indeed causing our difficulty, please? Is there anything else you see that would cause it?
2) It looks like you all have declined to fix this bug in the past. Still declining? :)
3) I could recommend that the documentation for UI Virtualization with RadTreeView here be updated, please, to to include some very obvious notes, a) that enabling virtualization will disable DefaultImageSrc and ExpandedImageSrc (and any other TreeView features that don't work with virtualization?), and b) that workarounds are necessary.
Thanks!
-David