Filtering in a master-details grid including all details views

Is it possible to have a filter that filters all of the details views at once?  For example, in the image below





is there a way I can somehow add a top level filter where I can type in for example "Bike1" somewhere (not sure where) and only the master rows which contain a detail row where ProductName is "Bike1" appear?

3 Replies

DY Deivaselvan Y Syncfusion Team October 4, 2018 07:38 PM UTC

Hi Tony,

Thank you for contacting Syncfusion support.

We have analyzed your query “To filter parent row based on the records in MasterDetailsView”. By default, in SfDataGrid search is performed for particular level of grid only. And it is not possible to achieve your requirement to filter the parent row based on child records with our architecture. We can achieve this using SfDataGrid.QueryRowHeight event by changing the row height of parent row based on child records but currently we do not have QueryRowHeight support for DetailsViewGrid.

However, you can search for all levels of grid using the below code snippet

 
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)  
{  
       foreach (SearchHelper search in FindSearchHelper(this.dataGrid))  
       {  
            search.Search(SearchBox.Text);  
       }  
}  
  
private List<SearchHelper> FindSearchHelper(SfDataGrid dataGrid)  
{  
            searchHelpers.Add(dataGrid.SearchHelper);  
            foreach (SfDataGrid subGrid indataGrid.DetailsViewDefinition.Cast<GridViewDefinition>().Select(x => x.DataGrid))  
            {  
                subGrid.SearchHelper.AllowFiltering = true;  
                searchHelpers.Concat(FindSearchHelper(subGrid));  
            }  
  
            return searchHelpers;  
}  

Please find sample for the same from below link and let us know if this helps you  



OS Ondrej Svoboda May 17, 2019 12:14 PM UTC

It would be great to have a possibility to filter the parent row based on child records. Do you have any plans about such feature?


DB Dinesh Babu Yadav Syncfusion Team May 20, 2019 09:48 AM UTC

Hi Tony, 
 
Thanks for your update. 
 
Currently we don’t have plan to include this in our feature request list. Based on number of feature requests on this support, we will consider this in our feature request list. 
 
Regards, 
Dinesh Babu Yadav 


Loader.
Up arrow icon