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

Filtering Master Detail Tables

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Kacos
Top achievements
Rank 1
Mike Kacos asked on 01 Oct 2009, 02:59 PM
Hi,
     We have extended the Telerik Grid, and I'm trying to add some custom filtering to it.  Specifically to Master/Detail implementations of it.  What I'm trying to do is this.  If the Master Table has columns A, B and C, and Detail Table (I'm gonna assume only 1 detail table for our purposes) has columns X, Y and Z.  I would like to be able to allow the users to search for an Item in Column Z without having to expand each row in the MasterTable.  When the Search is complete, I would like only the MasterTableRows that have Detail rows with the search string to remain (to complicate this even futher if the searchstring is found in a MasterTableRow, I want that row to show also even if the search string wasn't found in that row's detail rows). 

I love the built-in Filtering you folks have in the grid, but because of this scenario above (plus the fact that we often allow users to search for items in columns that aren't necessarily visible) I can't seem to figure a way to use it.

So my questions are these...  Is there something I'm missing, and there actually is a way to use the built in filtering of the grid? 

If not, I've started down the path of building a MasterDetailQuickFilter method, and I need to be able to grab the Detail Tables ParentTableRelations.GridRelationFields MasterKeyField and DetailKeyField, so I can build my search string and apply it directly to the datasources for both the Master and Detail table.

I'm sorry if this is confusing (it's confusing to me as well).

-Mike

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Oct 2009, 02:49 PM
Hello Mike,

Unfortunately the built-in filtering is intended to work only per GridTableView and not for the detail tables. The ParentTableRelation is collection which is declared per GridTableView. If you need to grab the ParentTableRelation for the detail tables, you will need to set HierarchyLoadMode to "client" and use RadGrid1.MasterTableView.GetItems(GridItemType.NestedView); to get all nested views. Thus you can traverse the returned collection and get the required ParentTableRelation  collections.
Your second option is to perform search outside of the grid and depending on the returned result to expand the correct item.

Regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Mike Kacos
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or