Using Datagrid within RowDetailsTemplate of another Datagrid

前端 未结 2 928
眼角桃花
眼角桃花 2021-01-20 19:14

I would like to use a DataGrid within the RowDetailsTempalte of another Datagrid. This inner Datagrid should have its columns bound to a property of the current object in t

相关标签:
2条回答
  • 2021-01-20 19:43

    The last answer on this thread helped me: How is access inner Datagrid in Silverlight?.

    On the inner DataGrid I set ItemsSource="{Binding Phones}" and removed the DataContext.

    0 讨论(0)
  • 2021-01-20 20:04

    Use the RowDetailsTemplate instead: DataGrid.RowDetailsTemplate Property.

    You can bind to the DetailsVisibilityChanged event, and that will pass you the DataContext of the row that was clicked. From there you can retrieve the details data and update the RowDetailsTemplate accordingly.

    0 讨论(0)
提交回复
热议问题