Question

I know ListView pretty well, but never looked at DataGrid.

My question is simple - if you do not need editing in the list, does DataGrid provide any benefits comparing to ListView? Also, are there disadvantages of using DataGrid (more complex, performance, bugs, hard to style, etc...)?

Was it helpful?

Solution

ListView is a read-only control. The usual usage is to synchronize the list with a 'details view' comprised of TextBoxes.

The DataGrid does not lack anything that the ListView possesses, such as multiple selection modes, styling, etc. It does, however, provide support for some features on top of the ListView:

  • In-place editing of data

  • Transactional edits

  • Auto-column generation

  • Setting of RowDetails

Basically the question is - do you want in-place editing? If so, the DataGrid is an obvious choice. If not, the two are quite similar.

OTHER TIPS

DataGrid lets user sort the items by clicking on column headers.

Two more advantages of the DataGrid:

  1. Fixed Columns and Column Headers.
  2. Headers are styled more easily than in ListView.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top