📜  c# datagridview filter textbox - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:16.740000             🧑  作者: Mango

代码示例1
private void ChercheStextBox_TextChanged(object sender, EventArgs e)
    {
        var bd = (BindingSource)dataGridView3.DataSource;
        var dt = (DataTable)bd.DataSource;
        dt.DefaultView.RowFilter = string.Format("LibService like '%{0}%'", ChercheStextBox.Text.Trim().Replace("'", "''"));    
        dataGridView3.Refresh();


    }