I`m using C# 3.5 VS2008.
I have a populated DatagridView. It does`t have a DataSource. I populate it programatically.
I want to obtain the column values, and load it to a list.
For a column, I go through each Row and see if the particular cell has a value. If the cell has a value. I add it to the list. (See Code)
The issue is I have a few columns, and I feel its a bad idea to do this for fall. Very clumsy.
Is there a better way to do this. Can I use LINQ query to a DataGridView. A more elegant and effetient way to do this?
Any help or guidance will be greatly appreciated.
foreach (DataGridViewRow Row in GridView.Rows)
Time += Convert.ToDouble(Row.Cells.Value) * FuncPIExt();
if (Row.Cells.Value != null)
Locn += Convert.ToDouble(Row.Cells.Value) / FuncPIExt();