This is a migrated thread and some comments may be shown as answers.
How to set Grid PageSize 'All' by wrapper?
11 Answers 328 Views
This is a migrated thread and some comments may be shown as answers.
JASON
Top achievements
Rank 1
JASON asked on 03 Jul 2015, 04:05 AM
Hi,
The lastest release version (2015.2.624) add a useful feature that display 'all' option in pager.
But I didn't find it in ASP.NET MVC Wrapper function.
I try insert '0' pagesize and it seems as same as 'all' option.

.Pageable(pager => pager.PageSizes(new int[] { 5, 10, 20, 0 }))

But it displayed '0' in pager and I didn't find the method that change the 'all' message by MVC Wrapper.
It seems not exist in pager.Messages.

Can someone advise me, please?

11 Answers, 1 is accepted

Sort by
0
Accepted
Radoslav
Telerik team
answered on 06 Jul 2015, 10:50 AM
Hello,

In MVC wrappers the page sizes drop down containing “all” as option can be set with following declaration:

.Pageable(x => x.PageSizes(new List<object> { 10, 20, "all" }).Refresh(true))

However in the official Q2 version this setup leads to error. The good news is that this was fixed and the fix is available into the latest internal build. In order to use it you need to download the latest internal build dll.

If you need further assistance, do not hesitate to contact us again.

Regards,
Radoslav
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
Scott
Top achievements
Rank 1
answered on 30 Sep 2015, 03:13 PM
It looks like this made it in to the last public release (2015.3.916) and I can successfully set the values for the page sizes dropdown. However, when I select "all", it doesn't actually display all of the records. It displays the "loading" progress bar like it's working, but still always displays the same number of records as previously shown. (For example, if I had selected 10 to show 10 records per page and then select "all", it still only shows 10 records per page.
0
Scott
Top achievements
Rank 1
answered on 30 Sep 2015, 03:19 PM
Following up, it also looks like this is broken in regards to filtering the grid. If I have selected "all" and then filter the grid, it does actually show me all of the records, but then I can't clear the filter until I change the page size to something other than "all".
0
Radoslav
Telerik team
answered on 02 Oct 2015, 07:15 AM
Hello Scott,

I tried to reproduce the described issues on my side but to no avail. I am sending you a simple example with the 2015.3.916 version of the wrappers and scripts. Please check it out and let me know what differs in your case.
Additionally at a meantime could you please check that you have mvc dll and javascript files with the same 2015.3.916 version at your end?

Looking forward for your reply.

Regards,
Radoslav
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
Antonio
Top achievements
Rank 1
answered on 07 Apr 2016, 10:45 AM

Hi Radoslav,

We would like to use the "all" option to display all elements in a page, but we need to be able to translate its displayed value to any other language, using an application string resource.

"all", "todos", "alle"...

Is it possible?

Thanks.

0
Radoslav
Telerik team
answered on 08 Apr 2016, 07:04 AM
Hello Antonio,

To achieve the desired functionality you can use localization capabilities of the kendo grid widget. More information and live demo you can find here:
http://demos.telerik.com/kendo-ui/grid/localization
http://docs.telerik.com/kendo-ui/framework/localization/overview

I hope this helps.

Regards,
Radoslav
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
Antonio
Top achievements
Rank 1
answered on 11 Apr 2016, 10:57 AM

Hi Radoslav.

Thanks for your help, we have found that in spanish and german the string "All" not is translated, is "All" in both cases.(spanish: "Todos", german : "Alle").

For sample in kendo.messages.es-ES.min.js, kendo.ui.Pager.prototype.options.messages,{allPages:"All".

Moreover, where can translate strings like "items per page"?

Thanks in advance.

0
Antonio
Top achievements
Rank 1
answered on 11 Apr 2016, 11:59 AM
I forget mention the kendo version: 2016.1.112
0
Radoslav
Telerik team
answered on 12 Apr 2016, 07:26 AM
Hello Antonio,

Indeed I verified that the Spanish and German does not have translation for the ‘all’ pager option. However please note that the translations are not available for every language and some of the localization files may be incomplete. For more information on where to find the full list of available translations, refer to the section on contributing.

Also the string "items per page" can be found in the
kendo.ui.Pager.prototype.options.messages, itemsPerPage option.

I hope this helps.

Regards,
Radoslav
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
n/a
Top achievements
Rank 1
answered on 28 May 2020, 08:28 PM
It seems that the PageSizes in version 2019.3.1023 is declared as an int[] so I'm unable to use a List<object> to declare 'All'
0
Petar
Telerik team
answered on 01 Jun 2020, 11:31 AM

Hi Alexandra,

Your question is relevant in UI for ASP.NET Core context. No matter the current ticket is for UI for ASP.NET MVC, I am pasting my answer from the support ticket communication, in case it can be useful for someone else.

You can define "All" option for the Pageable DropDownList in the Grid by defining the Pageable configuration as follows:

.Pageable(pageable => pageable
                  .Refresh(true)
                  .PageSizes(new[] { 10, 20})
              )

and adding the following Javascript/jQuery code that will be executed on document.ready:

var grid = $('#grid').data('kendoGrid');

var pageSizeDropDownList = grid.wrapper.children(".k-grid-pager").find("select").data("kendoDropDownList");
console.log(pageSizeDropDownList)
pageSizeDropDownList.dataSource.add({text:"All", value:'all'})
pageSizeDropDownList.dataSource.sync()

The above approach is also demonstrated in this Set All Page Size in Grid for ASP.NET Core article.

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
JASON
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Scott
Top achievements
Rank 1
Antonio
Top achievements
Rank 1
n/a
Top achievements
Rank 1
Petar
Telerik team
Share this question
or