I have a DataGrid
. It has DataGrid.RowDetailsTemplate
. When a button is clicked it should Expand / Collapse; how would I do that?
<Custom:DataGrid RowDetailsVisibilityMode="VisibleWhenSelected" SelectionMode="Extended" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False">
<Custom:DataGrid.RowDetailsTemplate>
<DataTemplate>
<Custom:DataGrid>
<Custom:DataGrid.Columns>
<Custom:DataGridTextColumn Binding="{Binding idClient, Mode=Default}" Header="Ид" IsReadOnly="True"/>
<Custom:DataGridTextColumn Binding="{Binding name_client, Mode=Default}" Header="Имя" IsReadOnly="True"/>
</Custom:DataGrid.Columns>
</Custom:DataGrid>
</DataTemplate>
</Custom:DataGrid.RowDetailsTemplate>
<Custom:DataGrid.Columns>
<Custom:DataGridTemplateColumn>
<Custom:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Expander IsExpanded="True"/>
</DataTemplate>
</Custom:DataGridTemplateColumn.CellTemplate>
</Custom:DataGridTemplateColumn>
<Custom:DataGridTextColumn Binding="{Binding idPartner, Mode=Default}" Header="Ид" IsReadOnly="True"/>
<Custom:DataGridTextColumn Binding="{Binding name_partner, Mode=Default}" Header="Имя" IsReadOnly="True"/>
</Custom:DataGrid.Columns>
</Custom:DataGrid>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…