ItemTemplateSelector does not work as it should

4 posts, 0 answers
  1. pekkah
    pekkah avatar
    9 posts
    Member since:
    Apr 2007

    Posted 08 Nov 2010 Link to this post

    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.

  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 10 Nov 2010 Link to this post

    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
  3. DevCraft banner
  4. pekkah
    pekkah avatar
    9 posts
    Member since:
    Apr 2007

    Posted 10 Nov 2010 Link to this post

    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.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Nov 2010 Link to this post

    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
Back to Top