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

4 posts, 0 answers
  1. Parthasarathi
    Parthasarathi avatar
    24 posts
    Member since:
    Oct 2012

    Posted 10 Dec 2012 Link to this post

    Hi All,

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

    Regards,
    Partha.
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 11 Dec 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Parthasarathi
    Parthasarathi avatar
    24 posts
    Member since:
    Oct 2012

    Posted 12 Dec 2012 Link to this post

    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.
  5. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 13 Dec 2012 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready