Filter Multi Checkboxes w/ LoadSettings

8 posts, 0 answers
  1. Alex
    Alex avatar
    76 posts
    Member since:
    May 2015

    Posted 13 Jul 2017 Link to this post

    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'

  2. Stefan
    Admin
    Stefan avatar
    3067 posts

    Posted 17 Jul 2017 Link to this post

    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 visualization (charts) and form elements.
  3. Alex
    Alex avatar
    76 posts
    Member since:
    May 2015

    Posted 17 Jul 2017 in reply to Stefan Link to this post

    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);
        })

     

  4. Stefan
    Admin
    Stefan avatar
    3067 posts

    Posted 19 Jul 2017 Link to this post

    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.
  5. Alex
    Alex avatar
    76 posts
    Member since:
    May 2015

    Posted 19 Jul 2017 in reply to Stefan Link to this post

    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.

  6. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2500 posts

    Posted 21 Jul 2017 Link to this post

    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.
  7. Antonino
    Antonino avatar
    2 posts
    Member since:
    Oct 2019

    Posted 09 Jun 2020 Link to this post

    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 ) );
        }
     
    })
     
    [...]
  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2500 posts

    Posted 10 Jun 2020 Link to this post

    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.
Back to Top