WPF MvvM DataGrid Dynamic Columns

前端 未结 3 816
梦如初夏
梦如初夏 2020-12-03 05:02

I am searching about how to create the columns of the DataGrid from the ToolKit dynamic in MvvM way. But looks like it is impossible !

Is there some one that had to

3条回答
  •  一整个雨季
    2020-12-03 05:57

    Having a similar problem, I did not want to add another dependency property. My workaround was to organise the data to display in the DataGrid in a DataTable and bind the DataGrid ItemSource property to this DataTable (with of course AutoGenerateColumns set to true).

    It works well, DataGrids seem happy with DataTable as source.

提交回复
热议问题