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.
How to change “items per page” to "Items per page" in List view pager?
Regards,
Partha.
3 Answers, 1 is accepted
0
Hello Partha,
Regards,
Iliana Nikolova
the Telerik team
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.
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
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:
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.
the Telerik team
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 =
//...
Regards,
Iliana Nikolovathe Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!