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

Hierarchical grid filtering by value in the detail table

4 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 03 Sep 2010, 08:55 AM
Hi,

I have a question about the following scenario:

I have a hierarchical grid which contains products. Every product has a detail table (the inner grid) with the countries where this product is being sold. Each row in the detailed table represents a different country.

I would like to have a filter which filters by country on top level, meaning that I would set for example a value "France" in that filter and in the grid I would get only the products that are being sold in France (meaning that in their detailed tables they have a row for France).

What approach would you recommend in order to achieve this behavior?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 09 Sep 2010, 12:48 PM
Hello Vladimir,

The solution may vary depending on your datasource. For example, if you use SqlDataSource, you could filter the data in the details tables directly, using a WHERE clause and a control parameter(s) tied to an external dropdown.

I hope this helps.

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vladimir
Top achievements
Rank 1
answered on 09 Sep 2010, 01:13 PM
Hi Daniel,

thanks for your reply.

May be I haven't expressed myself clearly enough. I don't want to filter the details table, I want to filter the master table according to the rows in the details table.

So in the master table I have rows  with products. And for every product there is one details table with countries. I want to filter the master table so that it lists only products that have in their details table a country with certain name.

If I have this structure:

1. Product 1: Fanta
              1. France
              2. Italy
              3. Gemrany

2. Product 2: Sprite
              1. Spain
              2. France

I want to have a filter with the countries, and when I put there "Spain", in the master grid I would like to get only one row ("Product 2: Sprite") and it's details table shouldn't be filtered (so it will have two rows - for Spain and for France).

Thanks.


0
Accepted
Daniel
Telerik team
answered on 15 Sep 2010, 11:35 AM
Hello Vladimir,

Please check the attached demo and let me know whether it is suitable for your scenario. You can find a detached DB (SQL 2005) inside the archive.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vladimir
Top achievements
Rank 1
answered on 15 Sep 2010, 03:02 PM
Hi Daniel,

thanks for the solution. I used similar approach.

BR,
Vladimir
Tags
Grid
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Vladimir
Top achievements
Rank 1
Share this question
or