Listview vs datagrid

前端 未结 2 665
有刺的猬
有刺的猬 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:23

    Some points to consider that Colin Eber have stated in DataGrid vs GridView discussion:

    • ListView (GridView) is a readonly control out-of-the-box.The standard solution would be to synchronise the list with a 'details view' comprised of textBoxes
    • The DataGrid allows in-place editing of data
    • The DataGrid performs transaction edits (the row is treated as an atom)
    • The DataGrid support auto-column generation
    • The DataGrid has a RowDetails element (if you like that sort of thing!)
    • The DatGrid supports pretty much everything the ListView does, multiple selection modes, styling, etc ...

    And another important one:

    • The DataGrid has build-in sorting support by clicking on column header. While add sorting to ListView/GridView is absolutely possible, I'd rather prefer to have such kind of things out-of-the-box in DataGrid.

提交回复
热议问题