Load on demand Load more text translation

4 posts, 1 answers
  1. RR
    RR avatar
    49 posts
    Member since:
    Apr 2012

    Posted 18 Sep 2018 Link to this post

    how to apply translation to "load more" text appear when LoadOnDemand Manual at the end of the list view.?

     

  2. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 18 Sep 2018 Link to this post

    Hi Roshan,

    If you need to customize the content, for example to set a localized string to a Label, you can define your own LoadOnDemandTemplate.

    For example:

    <telerikDataControls:RadListView.LoadingOnDemandItemTemplate>
        <DataTemplate>
            <Grid>
                <Label Text="Bind this to your localized string" />
            </Grid>
        </DataTemplate>
    </telerikDataControls:RadListView.LoadingOnDemandItemTemplate>

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. RR
    RR avatar
    49 posts
    Member since:
    Apr 2012

    Posted 19 Sep 2018 Link to this post

    Thank you for the response. 

    After adding this the "Load more" text appears in a label sort of a component with a yellow background. I couldnt figure out a way to change the ui as well. I would like to keep the same default look and feel and apply the translation. Can this be achieved.?

  4. Answer
    Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 19 Sep 2018 Link to this post

    Hi Roshan,

    Take a look at the RadListView Load On Demand Advanced section of the documentation for a complete description and more examples.

    The two templates you can set are:

    - LoadOnDemandTemplate (this is the 'load more" button)
    - LoadingOnDemandTemplate (this is shown while the next set of items are being fetched)

    You have 100% control over the appearance in that template, if you want it to look like the default appearance, you can design your custom template that way. 

    Here's an example using both templates with a mock static helper class for the translation properties

    <telerikDataControls:RadListView x:Name="listView"
                      IsLoadOnDemandEnabled="True"
                      LoadOnDemand="ListView_LoadOnDemand"
                      LoadOnDemandMode="Manual">
     
        <!-- This is the button  -->
        <telerikDataControls:RadListView.LoadOnDemandItemTemplate>
            <DataTemplate>
                <Grid BackgroundColor="Yellow"
                   Padding="5">
                    <Label Text="{x:Static local:MyTranslationHelper.LoadMoreItemsText}"
                        TextColor="Black"
                        FontSize="24"
                        HorizontalOptions="Center" />
                </Grid>
            </DataTemplate>
        </telerikDataControls:RadListView.LoadOnDemandItemTemplate>
     
        <!-- This is shown while the items are being fetched  -->
        <telerikDataControls:RadListView.LoadingOnDemandItemTemplate>
            <DataTemplate>
                <Grid BackgroundColor="Green"
                   Padding="5">
                    <Label Text="{x:Static local:MyTranslationHelper.LoadingMoreItemsText}"
                        TextColor="White"
                        FontSize="24"
                        HorizontalOptions="Center" />
                </Grid>
            </DataTemplate>
        </telerikDataControls:RadListView.LoadingOnDemandItemTemplate>
    </telerikDataControls:RadListView>


    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top