Listview vs datagrid

前端 未结 2 668
有刺的猬
有刺的猬 2021-02-07 07:55

What are the main advantages of using a datagrid control over using a listview? When should each one be used?

2条回答
  •  误落风尘
    2021-02-07 08:09

    I've abandoned the ListView for the DataGrid in .Net 4, since templating the columns is easier.

    Layout is also more sensible, and I don't need to remember to set the HorizontalContentAlignment to Stretch to get the cell contents to cover the cell. Another nice bit of functionality is edit templates on the DataGrid, which relieves me of having to use a CellTemplateSelector to get a different control when editing the cell.

提交回复
热议问题