I need the Expand / Collapse for RowDetailsTemplate

前端 未结 5 923
北荒
北荒 2020-12-09 09:56

I have a DataGrid. It has DataGrid.RowDetailsTemplate. When a button is clicked it should Expand / Collapse; how would I do that?

&         


        
5条回答
  •  -上瘾入骨i
    2020-12-09 10:48

    Selecting a Row on the Grid should expand the Row using the RowDetailsTemplate to display the content. This makes that Row the Selected Row and sets the value of the DataGrid's SelectedIndex Property.

    To collapse the Row set the DataGrid's SelectedIndex Property to -1.

提交回复
热议问题