What is the difference between ListView and GridView in WPF?

I am trying to create a WPF database application. There seem to be some good components that I can use to display data in database tables. ListViewand GridVieware apparently popular for this use. But for beginners it is difficult to understand the difference between the two.

What is the difference between ListViewand GridView? What are the pros and cons?

+5
source share
2 answers

ListView is a WPF control derived from a ListBox that (theoretically) can display items using one of several view modes that are derived from ViewBase. GridView is the only one implemented. In other words, it is not a choice of ListView or GridView. If you want to display tabular data in a ListView, you must create a ListView and set its view to a GridView (which defines the layout of the column.)

The reality, however, is that, as far as I know, no other views have been realized. And since ListView is not a very feature-rich control, it is pretty much out of date at this point. In fact, Silverlight does not even provide a ListView.

DataGrid, API Silverlight DataGrid, , , ListView.

+6

A ListView - , :

ListView - ItemsControl, , (, , ). . ItemsControl.

ListView , View. Windows Presentation Foundation (WPF) GridView, ListView . GridView .

GridView , :

, ListView.

GridView , ListView .

+5

All Articles