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

RadTabItem.ContentTemplateSelector

2 Answers 107 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Shawn Shaddock
Top achievements
Rank 1
Shawn Shaddock asked on 28 Jul 2009, 03:54 PM
I am trying to bind a collection of workspaces to the RadTabControl and use a DataTemplateSelector to choose the DataTemplate for the content based on which type of workspace is being rendered but the RadTabItem does not appear to use the DataTemplateSelector that I set. Here is an example of my code:

        <telerik:RadTabControl ItemsSource="{Binding Workspaces}"
            <telerik:RadTabControl.Resources> 
                <Style TargetType="{x:Type telerik:RadTabItem}"
                    <Setter Property="ContentTemplateSelector"
                        <Setter.Value> 
                            <local:TabItemContentTemplateSelector /> 
                        </Setter.Value> 
                    </Setter> 
                </Style> 
            </telerik:RadTabControl.Resources> 
        </telerik:RadTabControl> 

I put a breakpoint in the SelectTemplate method but it never reaches it.

Has anyone got this to work?

2 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 03 Aug 2009, 08:19 AM
Hello Shawn,

This seems to be a bug from the RadTabControl. It does have a SelectedContent and SelectedContentTemplate properties but not SelectedContentTemplateSelector property, which is what is why it is not working in your case. We will be fixing this for a coming SP or internal build. I will follow up with a reply here once this has been fixed.

Your Telerik Points have been updated for your feedback.

Greetings,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Miroslav
Telerik team
answered on 29 Aug 2009, 02:18 PM
Hi Shawn,

I just wanted to follow up on this issue

Three properties has been added to the TabControl:  SelectedContentTemplateSelector, ContentTemplate and ContentTemplateSelector (for the items that do not have content set).

The changes will be available with the Beta release of the controls, expected in september.

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TabControl
Asked by
Shawn Shaddock
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or