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

Kendo grid filtering

2 Answers 490 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PAUL
Top achievements
Rank 1
PAUL asked on 18 Sep 2012, 06:21 PM
Telerik had an attribute for the rad_grids called AllowFilteringByColumn="true" which allowed us to filter the records by criteria entered in the textboxes or datepickers at the top of the grid.

Does Kendo do this and is there an example?

All I found in documentation is adding Filterable to the columns which takes true or false. Nothing else and it doesn't do anything.

The other was setting the grid to Filterable which takes no arguments and does nothing so I have no idea...

Thanks for your help...

Paul

2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 21 Sep 2012, 12:45 PM
Hi Paul, 


You can enable the filtering UI of Grid with .Filterable() method in the Grid definition:

e.g.:
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()   
    .Name("Grid")   
    .Columns(columns => {       
        columns.Bound(p => p.ProductName);
        columns.Bound(p => p.UnitPrice).Width(140);
        columns.Bound(p => p.UnitsInStock).Width(140);
        columns.Bound(p => p.Discontinued).Width(100);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .Filterable()

 Also please note that after enabling filtering UI of the Grid each column by default is set to .Filterable(true). You can chage the dafault setting and make it not filterable by .Filterable(false):

    columns.Bound(p => p.UnitPrice).Width(140); //Filtering enabled on this column by dafault
    columns.Bound(p => p.UnitsInStock).Width(140).Filterable(false); //Filtering disbled on this column
    columns.Bound(p => p.Discontinued).Width(100).Filterable(false); //Filtering disbled on this column
})
.Filterable()

Please note that with your KendoUI for ASP.NET MVC installation comes offline demos which cointains example of Grid filtering (please see attached screenshot). These demos usually are located in:

  • ..\Telerik\Kendo UI for ASP.NET MVC %VERSION%\wrappers\aspnetmvc\Examples


Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
PAUL
Top achievements
Rank 1
answered on 24 Sep 2012, 01:23 PM
Hello Vladimer,

Thanks for reply. The screen shot is exactly what I want to do with the filtering of columns. I will look in the examples and see what I can find out.

Thank you

Paul
Tags
Grid
Asked by
PAUL
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
PAUL
Top achievements
Rank 1
Share this question
or