c# - Getting the content of the cell of a selected row from DataGridView -
this question has answer here:
- accessing gridview cells value 3 answers
string feeid = grdvw.rows[index].cells[0].text;
is correct way retrieve content of cell in selected row? if use this, not value. so, please suggest best way.
yes, that's way it, can like:
string feeid = grdvw.rows[index].cells[0].value;
also, if want values rows iterate through datagridview this:
foreach (datagridviewrow row in grdvw.rows) { string column0 = row.cells[0].value; string column1 = row.cells[1].value; //more code here }
Comments
Post a Comment