This is a migrated thread and some comments may be shown as answers.

Change “items per page” to "Items per page" in List view pager

3 Answers 1043 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Parthasarathi
Top achievements
Rank 1
Parthasarathi asked on 10 Dec 2012, 10:15 AM
Hi All,

How to change “items per page” to "Items per page" in List view pager?

Regards,
Partha.

3 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 11 Dec 2012, 05:06 PM
Hello Partha,

You could customize the text shown within the pager through the messages object. For example the following code snippet can be used to change the text displayed after the select element on the pageSizes mode: 

$("#pager").kendoPager({
   messages: {
      itemsPerPage: "Items per page"
   }
});

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Parthasarathi
Top achievements
Rank 1
answered on 12 Dec 2012, 06:42 AM
Hi Iliana,

Below is my code. I have tried 'messages' object by putting in OnDataBound event of ListView. But it is not reflecting.
Note: In asp.net mvc view, I have 2 Listviews. 'messages' object should be reflected for both Listview. Which is the right way? How we can do that? Please help in this case.

@(Html.Kendo().ListView<Model>()
        .Name("name")
        .Events(events => events.DataBound("OnDataBound"))
        .TagName("div")
        .ClientTemplateId("template")
        .DataSource(source =>
                source.Read(read => read.Action("Action", "Controller"))
        .PageSize(10))
        .Selectable(selection =>
        {
            selection.Enabled(true);
            selection.Mode(ListViewSelectionMode.Multiple);
        })
                .Pageable(pager => { pager.PageSizes(true);})
        )
 function OnDataBound(e)
 {
 $("#pager").kendoPager({
            messages: {
                itemsPerPage: "Items per page"
            }
        });
 }

Regards,
Partha.
0
Iliana Nikolova
Telerik team
answered on 13 Dec 2012, 03:57 PM
Hello Partha,

First of all let me apologize for the misunderstanding - the provided solution is for Kendo UI Web ListView, while it appears you are using Kendo UI for ASP.NET MVC. The desired result can be achieve through the Localization - just modify the source resources files of the MVC extensions project and create a custom build. For example:
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture =//...
Hence the ListView Pager will automatically display the messages from the resource assembly. For more detailed information about the Localization take a look at the corresponding documentation

Regards,

Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView
Asked by
Parthasarathi
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Parthasarathi
Top achievements
Rank 1
Share this question
or