selectedindex in datatemplate is not working...

4 posts, 0 answers
  1. Bruce SeungWon
    Bruce SeungWon avatar
    3 posts
    Member since:
    Mar 2011

    Posted 30 Mar 2011 Link to this post

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

    Posted 04 Apr 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Daniel
    Daniel avatar
    2 posts
    Member since:
    Apr 2012

    Posted 21 Jun 2013 Link to this post

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

    Posted 26 Jun 2013 Link to this post

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