Hello,
After long searches, I have finally found a way to (somehow) achieve my requirement to display my Resources in some sort of Hierarchical groups, through a TreeView.
This works quite well, as the TreeView can even be seen as a row header in some way.
However, I got some new Requirements.
I need to display my Treeview in another part of my View (or even hide it)
Therefore, I thought, that it might be possible to modify my CustomGroupHeaderContentTemplateSelector to Bind its Content (instead of an empty Content)
<telerik:GroupHeaderTemplateSelector x:Key=
"CustomGroupHeaderContentTemplateSelector"
>
<telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
<DataTemplate>
<ContentPresenter Content=
"{Binding FormattedName}"
Height=
"16"
Margin=
"4"
/>
</DataTemplate>
</telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
<telerik:GroupHeaderTemplateSelector.VerticalTemplate>
<DataTemplate>
<ContentPresenter Content=
""
Height=
"16"
VerticalAlignment=
"Top"
/>
</DataTemplate>
</telerik:GroupHeaderTemplateSelector.VerticalTemplate>
</telerik:GroupHeaderTemplateSelector>
to
<telerik:GroupHeaderTemplateSelector x:Key=
"CustomGroupHeaderContentTemplateSelector"
>
<telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
<DataTemplate>
<ContentPresenter Content=
"{Binding FormattedName}"
Height=
"16"
Margin=
"4"
/>
</DataTemplate>
</telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
<telerik:GroupHeaderTemplateSelector.VerticalTemplate>
<DataTemplate>
<ContentPresenter Content=
"{Binding}"
Height=
"16"
VerticalAlignment=
"Top"
/>
</DataTemplate>
</telerik:GroupHeaderTemplateSelector.VerticalTemplate>
</telerik:GroupHeaderTemplateSelector>
On Start, the application works (and displays its data) as expected
BUT,
I came across a MAJOR PROBLEM that you can reproduce in attached sample
When you collapse both items of the TreeView - then expand one (look at header of each row) - then collapse it - then expand it again, you can see that the header text has changed in a way I cannot re-enact (take a look at attached pictures)
My questions now are:
What causes this kind of behaviour?
Is there a way I can avoid this Problem?
What do you recommend, to achieve my Requirements?
P.S.: - The sample is one of yours (Telerik), with only the slight change/add of a binding
- Yes I even tried it with the latest telerik release 2017.1.117
- As it is still not possible to add a .rar file to a post in your forum I hosted the sample project at onedrive: https://1drv.ms/u/s!AqROZw-XiIMygxUHdEcNdVy83H-y