C# Winform DataGridView New added row value
How can I retrieve the value of a new row? Whi开发者_开发百科ch action/event can I use to get these values?
(e.Row.Cells["COLUMN NAME"].Value.ToString());
if I understand you want to retrieve the contents of a cell of the DataGridView, an example and use the event rowValidated, see example below.
private void dataGridView1_RowValidated(object sender, DataGridViewCellEventArgs e)
{
if (this.dataGridView1.CurrentRow != null)
{
this.textBox1.Text = this.dataGridView1.CurrentRow.Cells["Column1"].Value.ToString();
}
}
If you mean another, possibly explaining what vouoi get.
Regards.
精彩评论