Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# datagridview filter textbox

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();


    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #datagridview #filter #textbox
ADD COMMENT
Topic
Name
5+6 =