WPF Datagrid binding and column display

前端 未结 3 2094
死守一世寂寞
死守一世寂寞 2021-01-04 01:33

I have datatable as Item source for DataGrid, this datatable has lots of columns. Is it possible to display few columns instead all of them without creating a new table?

3条回答
  •  难免孤独
    2021-01-04 02:06

    Also, you can handle DataGrid.AutoGeneratingColumn event and set e.Cancel = true for columns that you don't want to be shown. This way you don't have to manually define columns that you want to show.

提交回复
热议问题