I have a DataGrid
. It has DataGrid.RowDetailsTemplate
. When a button is clicked it should Expand / Collapse; how would I do that?
&
Include Collapsed and expanded events as below
In the code behind
private void exp_Collapsed(object sender, RoutedEventArgs e)
{
this.dataGrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed;
}
private void exp_Expanded(object sender, RoutedEventArgs e)
{
this.dataGrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.VisibleWhenSelected;
}