RadBook and RadDataPager

2 posts, 0 answers
  1. Dima
    Dima avatar
    1 posts
    Member since:
    Jun 2010

    Posted 27 Jun 2010 Link to this post

    Page added the following
      <UserControl.Resources>
            <DataTemplate x:Key="DummyPageTemplate">
                <Border BorderBrush="Black" BorderThickness="2" Background="LightGray">
                    <TextBlock Text="{Binding Name}" HorizontalAlignment="Center"
                            VerticalAlignment="Center" />
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="DataPageTemplate">
                <Border BorderBrush="Black" BorderThickness="2" Background="LightGray">
                    <Image Source="{Binding ImageSource}" />
                </Border>
            </DataTemplate>
            <local:PageTemplateSelector x:Key="PageTemplateSelector"
                    DataPageTemplate="{StaticResource DataPageTemplate}"
                    DummyPageTemplate="{StaticResource DummyPageTemplate}" />
        </UserControl.Resources>
        <Grid VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions >

            <telerikGridView:RadDataPager x:Name="radDataPager2" HorizontalAlignment="Center"
                    Source="{Binding ItemsSource, ElementName=book1}"
                    DisplayMode="All" PageSize="1" Width="750" />
            <telerikNavigation:RadBook x:Name="book1" Width="750" Grid.Row="1"
                    LeftPageTemplateSelector="{StaticResource PageTemplateSelector}"
                    RightPageTemplateSelector="{StaticResource PageTemplateSelector}"  
                    IsKeyboardNavigationEnabled="True" Margin="0 1" 
                     />
            <telerikGridView:RadDataPager Grid.Row="2" x:Name="radDataPager1"
                    HorizontalAlignment="Center" Source="{Binding ItemsSource, ElementName=book1}"
                    DisplayMode="All" IsTotalItemCountFixed="True"
                     Width="750"  PageSize="1"/>
        </Grid>

    But the book does not leafing through page by clicking on the page. What is the problem?






  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 29 Jun 2010 Link to this post

    Hello Dima,

    In the RadDataPager, instead of binding to RadBook's ItemsSource, you need to bind to RadBook's PagedItems property:

    <telerikGridView:RadDataPager x:Name="radDataPager2" HorizontalAlignment="Center"
                    Source="{Binding PagedItems, ElementName=book1}" DisplayMode="All" PageSize="1"
                    Width="750" />

    Give it a try and let me know how it works for you.

    On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverilght applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

    Sincerely yours,
    Kiril Stanoev
    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
Back to Top