【发布时间】:2014-04-14 10:54:11
【问题描述】:
我从我的服务器下载数据并使用DataGridView 来呈现结果。添加新行时,我希望我的程序显示一个信号。我该怎么做?
【问题讨论】:
标签: mysql vb.net winforms datagridview
我从我的服务器下载数据并使用DataGridView 来呈现结果。添加新行时,我希望我的程序显示一个信号。我该怎么做?
【问题讨论】:
标签: mysql vb.net winforms datagridview
订阅DataGridView.RowsAdded 活动。
dataGridView1.RowsAdded += new DataGridViewRowsAddedEventHandler(dataGridView1_RowsAdded);
void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
// show the signal
}
【讨论】:
您需要使用 userAddedRow 事件,当激活该事件时,您可以使用它来发送 boolean like true or false like this Example
private void usersDGV_UserAddedRow(object sender, DataGridViewRowEventArgs e)
{
//this event occurs when user added new row to the datagridview
//and will turn the boolean newRowAdded on.
newRowAdded = true;
}
【讨论】: