Delete "No Data to Display" Message

6 posts, 1 answers
  1. slnee
    slnee avatar
    18 posts
    Member since:
    Sep 2014

    Posted 14 Oct 2014 Link to this post

    Hello,
    Im working with PaginationControl and i like to dont display the "No Data to Display" message when there is no PageProvider set.

    Here is My Code:

    <phone:PhoneApplicationPage
        x:Class="TelerikWindowsPhoneApp5.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
        xmlns:telerikPagination="clr-namespace:Telerik.Windows.Controls.Pagination;assembly=Telerik.Windows.Controls.Primitives"

        mc:Ignorable="d"
        FontFamily="{StaticResource PhoneFontFamilyNormal}"
        FontSize="{StaticResource PhoneFontSizeNormal}"
        Foreground="{StaticResource PhoneForegroundBrush}"
        SupportedOrientations="Portrait"  Orientation="Portrait"
        shell:SystemTray.IsVisible="True">
        <phone:PhoneApplicationPage.Resources>
            <SolidColorBrush x:Key="highlightBrush" Color="#1ba1e2"/>
            <DataTemplate x:Key="dot">
                <Border Width="28" Height="28" Background="#00FFFFFF">
                    <Ellipse Stroke="{StaticResource PhoneForegroundBrush}"
                             StrokeThickness="2" Width="8" Height="8"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"/>
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="dotFilled">
                <Border Width="28" Height="28" Background="#00FFFFFF">
                    <Ellipse Fill="{StaticResource PhoneForegroundBrush}"
                             Width="12" Height="12"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"/>
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="thumbnail">
                <Image Source="{Binding ThumbnailPicture}" Width="90" Height="60" Opacity="0.8" Margin="0,6,0,0"/>
            </DataTemplate>
            <DataTemplate x:Key="thumbnailSelected">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Image Stretch="None" Source="Images/current-item.png" HorizontalAlignment="Center" VerticalAlignment="Top"/>
                    <Image Source="{Binding ThumbnailPicture}" Width="90" Height="60" Grid.Row="1"/>
                    <Border BorderBrush="{StaticResource highlightBrush}" BorderThickness="4" Grid.Row="1"/>
                </Grid>
            </DataTemplate>
        </phone:PhoneApplicationPage.Resources>
        <!--LayoutRoot is the root grid where all page content is placed-->
        <Grid x:Name="LayoutRoot" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

             
            <!--TitlePanel contains the name of the application and page title-->
            <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
                <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
            </StackPanel>

            <!--ContentPanel - place additional content here-->
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <telerikPrimitives:RadPaginationControl   Background="Black" Opacity="0.65"
                                          DisplayMode="Thumbnails"
                                          ItemTemplate="{StaticResource dot}"
                                          CurrentItemTemplate="{StaticResource dotFilled}"
                                          x:Name="pagination"
                                          NavigationMode="Adjacent"
                                          BorderThickness="0,0,0,1"
                                           
                                          Margin="0,0,0,0" >
                    <telerikPrimitives:RadPaginationControl.LayoutDefinition>
                        <telerikPrimitives:PaginationControlLayoutDefinition IndexLabelPosition="0,0"
                                                               LeftArrowPosition="1,0"
                                                               RightArrowPosition="1,2"
                                                               ThumbnailListPosition="1,1">
                            <telerikPrimitives:PaginationControlLayoutDefinition.Rows>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </telerikPrimitives:PaginationControlLayoutDefinition.Rows>
                            <telerikPrimitives:PaginationControlLayoutDefinition.Columns>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </telerikPrimitives:PaginationControlLayoutDefinition.Columns>
                        </telerikPrimitives:PaginationControlLayoutDefinition>
                    </telerikPrimitives:RadPaginationControl.LayoutDefinition>
                    <telerikPrimitives:RadPaginationControl.IndexLabelStyle>
                        <Style TargetType="telerikPagination:PaginationIndexLabelControl">
                            <Setter Property="HorizontalAlignment" Value="Left"/>
                            <Setter Property="VerticalAlignment" Value="Top"/>
                            <Setter Property="Grid.ColumnSpan" Value="2"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="telerikPagination:PaginationIndexLabelControl">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{TemplateBinding CurrentIndexDisplayValue}"
                                                   FontSize="{StaticResource PhoneFontSizeLarge}"
                                                   FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                                            <TextBlock Text="{TemplateBinding Separator}"
                                                   Margin="0,10,0,0"/>
                                            <TextBlock Text="{TemplateBinding ItemCountDisplayValue}"
                                                   FontSize="{StaticResource PhoneFontSizeMedium}"
                                                   FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                                   VerticalAlignment="Bottom"
                                                   Margin="0,0,0,1"/>
                                        </StackPanel>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </telerikPrimitives:RadPaginationControl.IndexLabelStyle>
                    <telerikPrimitives:RadPaginationControl.ThumbnailListStyle>
                        <Style TargetType="telerikPagination:PaginationThumbnailListControl">
                            <Setter Property="Height" Value="20"/>
                            <Setter Property="HorizontalAlignment" Value="Center"/>
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="Canvas.ZIndex" Value="-1"/>
                            <Setter Property="Margin" Value="0,0,0,0"/>
                        </Style>
                    </telerikPrimitives:RadPaginationControl.ThumbnailListStyle>

                </telerikPrimitives:RadPaginationControl>
            </Grid>
        </Grid>
    </phone:PhoneApplicationPage>



    Thanks for Help
  2. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 17 Oct 2014 Link to this post

    Hello,

    In a scenario with DisplayMode="Thumbnails"  the RadPaginationControl uses a PaginationThumbnailListControl which inherits from a RadDataBoundListBox. So, in order to change the No Data to Display message, you should override the DataBoundListBoxEmptyContentKey in the PrimitivesLocalizationManager.

    I hope this helps. Let me know should you need further assistance.

    Regards,
    Ivaylo Gergov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. slnee
    slnee avatar
    18 posts
    Member since:
    Sep 2014

    Posted 17 Oct 2014 in reply to Ivaylo Gergov Link to this post

    hi,
    thanks for reply,

    i need more assistance how can i do it?

    thanks
  5. slnee
    slnee avatar
    18 posts
    Member since:
    Sep 2014

    Posted 20 Oct 2014 in reply to Ivaylo Gergov Link to this post

    Hi,
    Any Help please
  6. Answer
    Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 21 Oct 2014 Link to this post

    Hi,

    You can create a class that inherits from the IStringResourceLoader and override the ListBoxEmptyContent key and then assign this class to the PrimitivesLocalizationManager.Instance.StringLoader property. For example: 

    public class MyPrimitivesStringLoader : IStringResourceLoader
    {
        public string GetString(string key)
        {
            switch (key)
            {
                case "ListBoxEmptyContent":
                    return " ";
            }
            return null;
        }
    }

    PrimitivesLocalizationManager.Instance.StringLoader = new MyPrimitivesStringLoader();

    More about controls localization can be found in our online documentation : http://www.telerik.com/help/windows-phone/localization-overview.html.

    Let me know if this helps.

    Regards,
    Ivaylo Gergov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. slnee
    slnee avatar
    18 posts
    Member since:
    Sep 2014

    Posted 21 Oct 2014 in reply to Ivaylo Gergov Link to this post

    Thanks Ivaylo Gergov it works fine.
Back to Top
DevCraft banner