This is a migrated thread and some comments may be shown as answers.

Filter Multi Checkboxes w/ LoadSettings

7 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 13 Jul 2017, 04:53 PM

re: https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes

 

Is there a way to do filtering with check boxes but via LoadSettings? There does not seem to be a property in 'Field' that corresponses to 'Multi'

7 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Jul 2017, 06:36 AM
Hello Alex,

I can assume that with LoadSettings means that the Grid will be loaded with a JSON formatted setting coming from the server for example.

If this is the case, then the multi property is set via columns[i].filterable.multi = true.

A similar format can be observed in our jQuery demo:

http://demos.telerik.com/kendo-ui/grid/filter-multi-checkboxes

If my assumption is not correct, please provide more details about the scenario and I will gladly assist.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Alex
Top achievements
Rank 1
answered on 17 Jul 2017, 01:10 PM

No, I am using the Razor function, wee below. "Model.Columns" is a list of objects that descend from "GridColumnSettings". GridColumnSettings does not contain a property called Filterable. The only thing filter related it contains is called "FilterUIRole", which is an enum. It seems the value I want to set doesn't even exist.

@(Html.Kendo().Grid<dynamic>()
    .ToolBar(toolBar =>
    {
 
        toolBar.Template(
            @<text>
                @Helpers.ToolbarTemplate(this, Model)
            </text>
            );
    })
    .Name(gridName)
    .Columns(columns => {
        columns.Select().Width(50);
        columns.LoadSettings(Model.Columns);
    })

 

0
Stefan
Telerik team
answered on 19 Jul 2017, 07:40 AM
Hello Alex,

Thank you for the clarification.

Indeed, not all of the properties are available when using the LoadSettings option.

I logged an issue in our GitHub repository for adding all of the other options.

In the meantime, I can suggest using the other approach for setting the column options:

.Columns(columns => {
    columns.Bound(p => p.OrderID).Filterable(false);
    columns.Bound(p => p.Freight);
    columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}");
    columns.Bound(p => p.ShipName);
    columns.Bound(p => p.ShipCity);
})

Apologies for the inconvenience this may have caused you.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Alex
Top achievements
Rank 1
answered on 19 Jul 2017, 01:36 PM

Can I get some more information about that "issue", i.e. priority, status, etc?

I need to use the LoadSettings method because we have a re-usable grid control that we built using the kendo grid.The alternative is not doable.

0
Viktor Tachev
Telerik team
answered on 21 Jul 2017, 09:33 AM
Hi Alex,

You can monitor the status of the issue in our feedback portal in the following link. Furthermore, other users can also vote for the feature in order to increase its priority.




Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Antonino
Top achievements
Rank 1
answered on 09 Jun 2020, 08:40 AM

I have landed here after stumbling on the same issue. It seems the LoadSettings way does not support all of the features in the column configurator.

In my case we had a grid with a variable number of columns (generated dynamically) and that was why using the "normal" way wasn't an option.

Here is how I got around it:-

1. Extended the GridColumnSettings class to accommodate the extra features I wanted.

2. Instead of passing the List<GridColumnSettings> to the .LoadSettings method, iterated through the new list and used the "normal" way to configure the columns. Something like this:

[...]
 
.Columns(columns => {
 
    foreach(CustomGridColumnSettings column in Model.ColumnSettings)
    {
        columns.Bound(column.Member)
        .Width(column.Width)
        .Title(column.Title)
        .ClientTemplate(column.ClientTemplate)
        .IncludeInMenu(column.IncludeInMenu)
        .Hidden(column.Hidden)
        .Sortable(column.Sortable)
        .Filterable(f => f.Enabled(column.Filterable).Multi( column.FilterableMulti ) );
    }
 
})
 
[...]
0
Viktor Tachev
Telerik team
answered on 10 Jun 2020, 02:09 PM

Hi Antonino,

 

Thank you for sharing your implementation with the community. This can help someone looking for similar functionality.

 

Regards,
Viktor Tachev
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
Alex
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Alex
Top achievements
Rank 1
Viktor Tachev
Telerik team
Antonino
Top achievements
Rank 1
Share this question
or