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

[Solved] Filter with Related Grids

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ceramist
Top achievements
Rank 1
Ceramist asked on 30 Jun 2009, 02:09 AM
The demo page shows how to relate two RadGrids such that clicking a single row in the first grid restricts the records shown in the second grid.  However, is there a way to relate the two RadGrids such that all of the rows in the first grid restricts or filters all the records in the second grid?

Here is an example: The first grid contains a set of Customers and the second grid contains a set of Orders.  If a single row in the Customers grid is selected, then the second grid contains all the Orders which belong to the selected Customer.  (In fact, by selecting the appropriate code, the second grid could easily show all the Orders which do not belong to that Customer.)   The goal is to show all the Orders which belong to any of the Customers shown in the Customer grid.  This would permit a user to apply a filter to the Customer grid, such as customers which belong to a state, city, or area code, and the second grid would be restricted to Orders by those Customers which meet the filter criteria.

One suggestion was to relate the grids within a Master/Detail relation but that still associates the records specifically to each Customer.  By being able to Filter Related Grids, the user can then analyze Customers and Orders as sets of data instead of Orders related to a specific Customers.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Jul 2009, 12:19 PM
Hello Walter,

Basically, there is no straightforward approach to handle this setup.
One possible custom approach would be to use a custom select statement or a filter expression, to show all orders related to all the customers in grid1. For example, you can use an OR clause to iterate through all the items in the first grid, and enhance the select statement of the related grid accordingly.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Ceramist
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or