This is a migrated thread and some comments may be shown as answers.
Load on demand Load more text translation
3 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
RR
Top achievements
Rank 1
RR asked on 18 Sep 2018, 11:17 AM

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

 

3 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 18 Sep 2018, 02:48 PM
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
0
RR
Top achievements
Rank 1
answered on 19 Sep 2018, 10:55 AM

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.?

0
Accepted
Lance | Manager Technical Support
Telerik team
answered on 19 Sep 2018, 03:32 PM
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
Asked by
RR
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
RR
Top achievements
Rank 1
Share this question
or