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

Set datasource for in-row filters.

2 Answers 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Caleb
Top achievements
Rank 1
Caleb asked on 01 May 2018, 03:00 PM

Hello!

I've been trying to see if there's a way to set the datasource for in-row filtering? I'm confused since I added the filtering successfully to the in-menu filtering but the in-row just ignores and uses the default grid's datasource to fetch all filter options. Here's an excerpt from a defined column in the grid:

cols.Bound("JobNumber").Title("Job").Filterable(f => f.Multi(true).Search(true).DataSource(ds => ds.Read("JobNumbers", "Filter")));

So the above totally works as expected using the in-menu filtering but the in-row ignores this. Anyway to achieve what I'm looking for? Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 03 May 2018, 06:03 AM
Hello, Caleb,

Thank you for the information.

Could you please specify which is the referred in-row filter as in the provided code, the columns in using the MultiCheckBox filtering?

If the in-row filter is the Grid row filtering, then the column.filterable.cell.dataSource property has to be used:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.filterable.cell#columns.filterable.cell.dataSource

https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridBoundColumnFilterableBuilder#methods-DataSource(System.Action%3CKendo.Mvc.UI.Fluent.ReadOnlyDataSourceBuilder%3E)

If the filter is different please let me know and I will gladly assist further.


Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Caleb
Top achievements
Rank 1
answered on 04 May 2018, 11:10 PM

Hi Stefan!

Thanks for the help. Such a small thing but I missed setting the filtering on the Cell itself. Here's the code that worked for me:

cols.Bound("JobNumber").Title("Job").Filterable(f => f.Cell(c => c.DataSource(ds => ds.Read("JobNumbers", "Filter"))));

Cheers!

Tags
Grid
Asked by
Caleb
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Caleb
Top achievements
Rank 1
Share this question
or