我从服务器下载数据并使用DataGridView
来显示结果。当添加新行时,我希望我的程序显示信号。我怎么能这样做?
答案 0 :(得分:1)
订阅DataGridView.RowsAdded
活动。
dataGridView1.RowsAdded += new DataGridViewRowsAddedEventHandler(dataGridView1_RowsAdded);
void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
// show the signal
}
答案 1 :(得分:0)
您需要使用userAddedRow事件,当激活该事件时,您可以使用它来发送 布尔值,如本例一样,为true或false
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;
}