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

Filter on Hierarchical grid

3 Answers 210 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdul
Top achievements
Rank 1
Abdul asked on 05 Dec 2014, 05:28 AM
Hey

I'm using Kendo Hierarchical grid, just as one of listed in your demos (http://demos.telerik.com/aspnet-mvc/grid/hierarchy). My issue is, I want to apply a filter on one of columns (on parent grid) such that it will also be applied on Child grid column. My issues are:

1. How do i know if there is filter applied on parent grid column, since there is no such even handler for filter on grid. 
2. I want to data appear in child grid columns(if exists), even if entry doesn't exist on parent grid column

I did some experiments by passing the filter collection from parent grid to child grid (since both have similar schema), but again, but couldn't sort out the answers for those two questions


Thanks

Abdul Rehman

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Dec 2014, 02:27 PM
Hello Abdul,

There isn't relation between grids in hierarchy. Parent grid doesn't know that it has child grid, neither does the child grid knows of the existence of its parent. 

That said applying filter expression to the master grid will only affect its items.

`1. How do i know if there is filter applied on parent grid column, since there is no such even handler for filter on grid. ` - you can inspect the filter expressions of the dataSource to see whether filtering is applied.

`2. I want to data appear in child grid columns(if exists), even if entry doesn't exist on parent grid column` - this is not possible. The grid will show only items available in the dataSource.view() which have filtered items.

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Abdul
Top achievements
Rank 1
answered on 23 Dec 2014, 12:08 PM
Thanks Nikolay for reply

`1. How do i know if there is filter applied on parent grid column, since there is no such even handler for filter on grid. ` - you can inspect the filter expressions of the dataSource to see whether filtering is applied.

Regarding this query, I know we can get the collection of applied filters thru data source properties, but that's on demand, Isn't there any event, which can let us know if a filter is applied rather querying Data source? 

In my case, Parent/Child grid are of same model. If we can get this event on parent grid, we can pass that filter object to child grid as soon as filter is applied..

Abdul Rehman 
0
Dimo
Telerik team
answered on 25 Dec 2014, 12:02 PM
Hello Abdul,

I am afraid the Grid does not expose specific events related to change in the filtering settings. You can pick any of the exposed Grid and DataSource events, or if none of them suits your requirements, use the DataSource API, as suggested.

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Abdul
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Abdul
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or