views:

117

answers:

1

What control should I use when wanting to display a list of record information (Name, ID #, date)? It is about 5 small columns, and I'll have many rows returned.

I'm using LINQ to grab the records I need from the database and have it currently in an IQueryable.

Can anyone suggest what WinForms control I should be using in this case (ListView, DataGridView, ListBox?

What is the standard for this use case?

+1  A: 

Its really up to how you would like to display the data, if you want to bind the data you could use the datagridview or even just a datagrid. Another option would be to use the new DataRepeater control. You can bind your linq resultset to a BindingSource then bind the BindingSource to the grid/repeater.

The other options are also ok, in fact I always use a list view if I want to display grouped data, I think it looks good. The downside is that you need to populate listviews manually (not really that big of a deal IMO). One other thing to note is that ListViews also have a virtual mode which is ideal for large result sets, but, of course the rule about avoiding dumping large resultsets into gui widgets still applies (that is, avoid it with good filtering at the source if possible)

Tim Jarvis