我正在實現基於選定按鈕過濾dataGridView。 如果選擇的按鈕1只顯示rID = 1的行,如果是2,那麼只有rID = 2 ... 工作正常。 問題是在dataGridView中添加新行。只要我添加新行,它就因爲過濾而隱藏在dataGridView中。我試過:添加新行以過濾DataGridView
private void dataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e)
{
DataGridViewRow row = e.Row;
row.Cells["rID"].Value = selectedRID;
}
但它沒有幫助。