I need to populate a .net DataGridView from a collection physically (without data binding) in C #. That is, I have to use foreach loops and iterate over the collection when creating a row for each object and cell for each property.
I created the columns in design mode. Now I need to dynamically create strings.
How to do it?
Add an array of objects, the number of which should correspond to the number of columns.
eg.
this.datagridview1.Rows.Add (new object [] {"col1", "col2", "col3", 4.5, true});
Source: https://habr.com/ru/post/1711796/More articles:How can I check if there is a WCF host before I use the channel from the client? - .netwhile (cin >> x) and problems with the end of the file - c ++How to choose the sum of numbers less than 30 and the sum of numbers more than 30? - sqlLast record of Join table - sqlДолжен ли я перейти на PHP 5.3? - phpMysql join syntax - databaseFlex Advanced Datagrid Condition Row Color - flexAbout the purpose of the font - cssWxPython menu doesn't display image - pythonHow can I look for simple if statements in C source code? - cAll Articles