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

selectedindex in datatemplate is not working...

3 Answers 163 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Bruce SeungWon
Top achievements
Rank 1
Bruce SeungWon asked on 30 Mar 2011, 10:29 AM
first 
Hello...
Im using two radtabcontrols..
itemssource ,DisplayMemberPath, ContentTemplate is working but selectedIndex is not working
I tried manything but that was not working...
please help me...

here is my source..
selectedIndex In stroyActtemplate is not working...

<
Grid>
        <Grid.Resources>
            <DataTemplate x:Key="StoryChapterTemplate">
                <TextBlock Text="{Binding Name}" />
            </DataTemplate>
            <DataTemplate x:Key="StoryActTemplate">
                <telerik:RadTabControl ItemsSource="{Binding TempSubList}" DisplayMemberPath="Name" ContentTemplate="{StaticResource StoryChapterTemplate}" SelectedIndex="{Binding Selected,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" />
            </DataTemplate>
        </Grid.Resources>
        <telerik:RadTabControl x:Name="tabControl" ItemsSource="{Binding TempSubList}" DisplayMemberPath="Name" ContentTemplate="{StaticResource StoryActTemplate}" SelectedIndex="{Binding Selected,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" />
        <Button Width="30" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="Button_Click">A</Button>
        <Button Width="30" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="40,0" Click="Button_Click_1">B</Button>
        <Button Width="30" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="Button_Click_2">C</Button>
        <Button Width="30" Height="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="40,0" Click="Button_Click_3">D</Button>
</Grid>

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 04 Apr 2011, 01:52 PM
Hello Bruce SeungWon,

Please examine the attached solution and lee us know if it helps you or not. Using INotifypropertyChanged interface  and UpdataSourceTrigger=PropertyChanged works fine at our side. Let us know if we are missing something too.

Kind regards,
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
0
Daniel
Top achievements
Rank 1
answered on 21 Jun 2013, 04:49 PM
In this configuration, SelectedIndex is not working for me either:

<telerik:RadTabControl x:Name="tabControl"
                               ContentTemplateSelector="{StaticResource ContentSelector}"
                               ItemTemplate="{StaticResource ItemTemplate}"
                               ItemsSource="{Binding Source={StaticResource DataSource},
                                                     Path=Reports}"
                               SelectedIndex="{Binding SelectedIndex,
                                                       UpdateSourceTrigger=PropertyChanged,
                                                       Mode=TwoWay}" />


UPDATE: never mind... my mistake. I was assigning {StaticResource DataSource} at the RatTabControl level instead of at the window level.
0
Petar Mladenov
Telerik team
answered on 26 Jun 2013, 11:04 AM
Hi Daniel,

 Could you please confirm that you have resolved this issue? We also encourage you to take advantage of our priority support where a 24-h response from us is guaranteed.

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TabControl
Asked by
Bruce SeungWon
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or