if (dataGridView1.Rows[e.RowIndex].Cells[1].Value != null) { string cellValue = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); if (!string.IsNullOrEmpty(cellValue)) { _bar = cellValue; PopulateColumns(); dataGridView1.Rows[e.RowIndex].Cells[2].Value = _proname; dataGridView1.Rows[e.RowIndex].Cells[3].Value = _price; dataGridView1.Rows[e.RowIndex].Cells[4].Value = _unit; } }
PopulateColumns();
dataGridView1.Rows[e.RowIndex].Cells[1].Value
DataRow dr; foreach(var row in myEnumerable) { //Do this in every loop dr = new DataRow(); //...Set column values dataTable.Rows.Add(dr); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)