This is a migrated thread and some comments may be shown as answers.

ItemTemplateSelector does not work as it should

3 Answers 109 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
pekkah
Top achievements
Rank 1
pekkah asked on 08 Nov 2010, 07:40 AM
I have a RadTabControl in my control set as follows:
<telerik:RadTabControl ItemsSource="{Binding Steps}"
                       ItemTemplateSelector="{StaticResource StepTemplateSelector}" />

Based on the documentation RadTabControl should use ItemTemplateSelector to pick the actual DataTemplate used to display item in ItemsSource. So it picks the ContentTemplate for RadTabItem from there. It seems that there is a bug with it as it picks the DataTemplate but uses it as the HeaderTemplate for RadTabItem not as content template. Content wrongly displays the Type name of the item in ItemsSource.

Another problem is with DisplayMemberPath. It should use DisplayMemberPath to display the header of RadTabItem when ItemTemplateSelector is used but instead I get a error that I cannot use DisplayMemberPath when I'm using ItemTemplateSelector.

So clearly it works differently than the documention says it should work.

3 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 10 Nov 2010, 10:31 AM
Hello pekkah,

 Unfortunately the help article about the ItemTemplate and ItemTemplateSelector of the RadTabControl is outdated and it's not correct. Currently the ItemTemplateSelector selects the header templates and the ContentTemplateSelector is for the content templates. The DisplayMemberPath doesn't work at the moment and I couldn't get an error with it, so I'll ask you if you could give me a little bit more information on that matter.
I've updated your telerik account.
I hope I was able to help you and if you have further questions feel free to ask.

All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
pekkah
Top achievements
Rank 1
answered on 10 Nov 2010, 10:51 AM
I actually got it working right after writing the original post. And yes it was the ContentTemplateSelector I needed to use. Funny that the documentation didn't mention anything about it. You really need to update the documentation to match the correct functionality. After changing my selector to use ContentTemplateSelector the DisplayMemberPath started working correctly too. So the issue is resolved and the fault was in incorrect documentation.
0
Petar Mladenov
Telerik team
answered on 12 Nov 2010, 05:04 PM
Hi pekkah,

Please accept our apology for the inconvenience again. We will update the article as soon as possible.

Feel free to ask if you need further assistance. We would be glad to help you.

All the best,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabControl
Asked by
pekkah
Top achievements
Rank 1
Answers by
Zarko
Telerik team
pekkah
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or