Is there any way to bind a winform ListView to a DataTable (or perhaps a list), in a similar manner in which it’s done in a listview from visual web gui (in the last one, the listview has a dataSource property to do so)?
I know it can be done by, going through each of the table’s elements and adding them to the ListView, but I would like to avoid using a foreach instrucction each time I have to fill a listview, or creating a method that recieve a listview as parameter and which fills the listview using a foreach.
As far as ListView is concerned there is no direct way of setting its data source to a data table or similar. The only way is to iterate the data table or list and manually fill the items of ListView.