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