开发者

C# Winform DataGridView New added row value

开发者 https://www.devze.com 2023-03-28 14:01 出处:网络
How can I retrieve the value of a new row? Whi开发者_开发百科ch action/event can I use to get these values?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消