Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
Remove features only in a selected columns
posted

Hi

 

how can i do this:

features.Sorting().ColumnSettings(settings => {

settings.ColumnSetting().ColumnKey("Detalle").AllowSorting(false);

});

features.Filtering().Type(OpType.Local).FilterButtonLocation(Location.Left)

        .ColumnSettings(settings =>

        {

                settings.ColumnSetting().ColumnKey("Detalle").AllowFiltering(false);

                });

but, in my controller, because i'm creating the grid here.

 

hope anybody help me.

Regards

Christhian Villa

  • 6279
    posted

    Hi Christian,

    Here is the code snippet that you need:

    GridSorting sorting = new GridSorting();
    sorting.Type = OpType.Remote;
    sorting.ColumnSettings = new List<ColumnSortingSetting>();
    sorting.ColumnSettings.Add(new ColumnSortingSetting() { ColumnKey = "ProjectId", AllowSorting = false});
    gridModel.Features.Add(sorting);
    
    GridFiltering filtering
    = new GridFiltering(); filtering.Type = OpType.Local; filtering.FilterButtonLocation = Location.Left; filtering.ColumnSettings = new List<ColumnFilteringSetting>(); filtering.ColumnSettings.Add(new ColumnFilteringSetting() { ColumnKey = "StartDate", AllowFiltering = false }); gridModel.Features.Add(filtering);
     

     I've attached a full MVC sample project to my reply demonstrating that these settings work so check it out in case you have any trouble with the code.



    Cheers,
    Borislav