首页 > 解决方案 > 如何更改datagridview最后一行的值

问题描述

我想选择 datagridview 的最后一行并使用文本框更改行值

标签: vb.net

解决方案


要使用文本框更改最后一行的值,请在文本框的 text_changed 事件下,输入以下代码:

Dim last As Integer = dataGridView1.Rows.Count - 1
dataGridView1.Rows(last).Cells(0).Value = Textbox1.Text
'sets the value of the last row of the datagridview to the value of the text in the textbox

推荐阅读