我想隐藏datagridview中与Access.text标签中的文本不匹配的所有行,我将如何实现此目的?该代码在程序运行时隐藏所有行
private void Access_TextChanged(object sender, EventArgs e)
{
BindingContext[productionBindingSource].SuspendBinding();
foreach (DataGridViewRow row in this.productionDGV.Rows)
{
if (row.Cells[4].Value.ToString() != Access.Text)
{
row.Visible = false;
}
}
BindingContext[productionBindingSource].ResumeBinding();
}