Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need header checkbox to select ALL rows when paging is active #172

Closed
sjoko opened this issue May 25, 2020 · 5 comments
Closed

Need header checkbox to select ALL rows when paging is active #172

sjoko opened this issue May 25, 2020 · 5 comments

Comments

@sjoko
Copy link

sjoko commented May 25, 2020

First of all … compliments to your work so far. A really good grid already, and I suspect there's more to come :-)

But … I’m using the SetCheckBoxColumn to select one or more rows, and I want to select ALL rows by ticking the header checkbox. Currently, only the rows on the current page are selected when the header box is ticked. Also, after visiting another page all row boxes are cleared yet the header box remains ticked.

Any suggestion how I could select all rows (and preserve their state?

@DSBhogal
Copy link

I'm having the same issue when filtering and searching on the grid

@gustavnavar
Copy link
Owner

Package version 1.6.7 implements this feature

@gustavnavar
Copy link
Owner

There is a change on the configuration. It's mandatory to identify the columns that are primary keys for the grid. You must do it using the SetPrimaryKey(true) method for the primary key columns' definitions:

    c.Add("CheckboxColumn").SetCheckboxColumn(true, o => o.Customer.IsVip);
    c.Add(o => o.OrderID).SetPrimaryKey(true);

@sjoko
Copy link
Author

sjoko commented Jun 8, 2020

Thanks very much ... works like a charm!

@gustavnavar
Copy link
Owner

gustavnavar commented May 29, 2024

Hi,

from your code I think that you are using ASP.NET MVC.

Selecting rows with a checkbox column is supported on .NET Blazor. So, you can switch to a Blazor project, or, if you want to continue using a MVC project, you can embed a Blazor component on a MVC view. This is described in the following documentation link: https://github.com/gustavnavar/Grid.Blazor/blob/master/docs/dotnetcore_blazor/Documentation.md

The project GridMvc.Demo includes a sample of a Blazor component on a MVC view:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants