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

Filtering hierarchical grids?

1 Answer 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 19 May 2008, 10:59 PM
How can i filter all the columns/rows in an hierarchical grid at the same time?
The GridView includes 2 tables, AccountName as Master and Contacts as detail. At runtime the GridView shows only the AccountName Column. Now i want to be able to search either an AccountName or a Contact by entering the search criterias in only one field.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 21 May 2008, 05:02 PM
Hi Michael,

Thank you for writing.

You can achieve the described filtering scenario by using different FilterExpressions for each column that you want to filter. Please review the code-block below:
 
FilterExpression filter1 = new FilterExpression(FilterExpression.BinaryOperation.OR,   
    GridKnownFunction.StartsWith, "myFilterCriteria");  
 
FilterExpression filter2 = new FilterExpression(FilterExpression.BinaryOperation.OR,  
                    GridKnownFunction.StartsWith, "myFilterCriteria");  
 
FilterExpression filter3 = new FilterExpression(FilterExpression.BinaryOperation.OR,  
    GridKnownFunction.StartsWith, "myFilterCriteria");  
 
this.radGridView1.MasterGridViewTemplate.Columns[1].Filter = filter1;  
this.radGridView1.MasterGridViewTemplate.Columns[2].Filter = filter2;  
this.radGridView1.MasterGridViewTemplate.ChildGridViewTemplates[0].Columns[1].Filter = filter3; 
 
I have prepared a small example application that demonstrates this approach, please find it attached.

If you need additional assistance, do not hesitate to contact me again.

 
Regards,
Martin Vasilev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or