Posted 15 May 2018, 6:32 pm EST
Hello,
For that you need to access the child grid using datagrid.Rows[rowIndex].DetailPresenter.Content and then set the child grid’s DetailsVisibility property to Visible/Collapsed for Expand/Collapse respectively, as follows:
if (gridCategories.Rows[0].DetailsPresenter !=null)
{
var childGrd = gridCategories.Rows[0].DetailsPresenter.Content as C1.WPF.DataGrid.C1DataGrid;
if (flagCollapse)
{
flagCollapse = false;
childGrd.Rows[2].DetailsVisibility = Visibility.Collapsed;
}
else
{
flagCollapse = true;
childGrd.Rows[2].DetailsVisibility = Visibility.Visible;
}
}
Please refer attached sample application.
Thanks,
RuchirNestedDataGrid_expand.zip