Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Add MultiSelection to Datagrid SelectColumn

Open Mr-Pearce opened this issue 1 year ago • 13 comments

Is your feature request related to a problem? Please describe. Currently you cannot select multiple entries in the DatagridGridSelectColumn

Describe the solution you'd like A Solution would be to add a Multiple mode from like https://blazorise.com/docs/extensions/selectlist so we could select multiple entries.

Additional context

Add any other context or screenshots about the feature request here.

Mr-Pearce avatar Jul 12 '24 12:07 Mr-Pearce

I proposed something like this earlier, would be a great addition. See https://github.com/Megabit/Blazorise/issues/5455 Also because the custom filter requires additional code if you want to save and read the state of the datagrid.

blenke avatar Jul 16 '24 09:07 blenke

We have multiple selection mode. Check the docs https://blazorise.com/docs/extensions/datagrid/selection/multiple

stsrki avatar Jul 16 '24 09:07 stsrki

I think that is different, that is for selecting multiple rows. The multi select we propose is for the select filter, now you can only select one value from the dropdown menu. What we looking for is that we can select 2 or more values so that a column gets filtered on that (its a bit like in Excel) .

blenke avatar Jul 16 '24 09:07 blenke

Yes I meant the filter. Currently you can only select one from the select. But multiple like in my example link would be nice. So we could filter for e.g. multiple states and so on

Mr-Pearce avatar Jul 16 '24 10:07 Mr-Pearce

@David-Moreira can you help?

stsrki avatar Jul 16 '24 10:07 stsrki

I think it makes sense, the problem is that we currently do not support multiple values filtering. Our internals are just not yet made for it.

Similar request was made where user wanted ~~a range of values~~ to be able to define 2 filter values that would represent the start and end for a date between filter: https://github.com/Megabit/Blazorise/issues/5586

David-Moreira avatar Jul 16 '24 11:07 David-Moreira

Ok, that part wasn't clear to me. Hopefully you can put this on the wish list for a future version. I can use my custom implementation but it got more complicated with the datagrid state management.

blenke avatar Jul 16 '24 13:07 blenke

I think it makes sense, the problem is that we currently do not support multiple values filtering. Our internals are just not yet made for it.

Similar request was made where user wanted ~a range of values~ to be able to define 2 filter values that would represent the start and end for a date between filter: #5586

How hard would it be to do it for 1.6? We still have some time left.

stsrki avatar Jul 16 '24 13:07 stsrki

I have to investigate. I'll let you know.

David-Moreira avatar Jul 16 '24 16:07 David-Moreira

I think it makes sense, the problem is that we currently do not support multiple values filtering. Our internals are just not yet made for it. Similar request was made where user wanted ~a range of values~ to be able to define 2 filter values that would represent the start and end for a date between filter: #5586

How hard would it be to do it for 1.6? We still have some time left.

hmm I think we need to introduce a list of search values, that if exist will be taken into consideration when searching.

Since we don't really want to be touching on the existing API I'd probably add

    /// <summary>
    /// Gets or sets the filter values.
    /// </summary>
    public List<object> SearchValues { get; set; }

    public void TriggerFilterChange( params object values )
    {
    SearchValues ....
    SearchValuesChanged...

    }

image It's a bit duplicated, but retro compatibility is a must so... Might not be too hard, basically just propagate it everywhere SearchValue currently exists, and change the Filtering to handle multiple values?

David-Moreira avatar Jul 20 '24 14:07 David-Moreira

Seems good. Create the PR, and I'll see how it behaves.

stsrki avatar Jul 20 '24 14:07 stsrki

Can existing SearchValue be used to store a List<> object type? So that we don't need to introduce new SearchValues just for this usecase.

stsrki avatar Jul 25 '24 14:07 stsrki

Can existing SearchValue be used to store a List<> object type? So that we don't need to introduce new SearchValues just for this usecase.

I think that might break too much stuff for users. I would do that in a 2.0.

David-Moreira avatar Jul 25 '24 16:07 David-Moreira

@David-Moreira, what do you think? How much would it take you for this?

PS. Considering that we already have Between logic so the Multiple would be fairly similar.

stsrki avatar Nov 13 '24 09:11 stsrki