DataGridView Filter by Multiple Columns
It filters only datatable and datatable's default view.
I want to filter my datagridview.
Here is my code again
DataSet ds = new DataSet();
SqlConnection conn = new SqlConnection("<>");
conn.Open();
SqlConnection conn = new SqlConnection("<
conn.Open();
SqlDataAdapter adp = new SqlDataAdapter();
SqlCommand comm = new SqlCommand();
comm.CommandText = "select name, surname from PERSON";
comm.Connection = conn;
adp.SelectCommand = comm;
DataTable dt = new DataTable("person");
adp.Fill(dt);
ds.Tables.Add(dt);
comm.Connection = conn;
adp.SelectCommand = comm;
DataTable dt = new DataTable("person");
adp.Fill(dt);
ds.Tables.Add(dt);
bindingSource1.DataSource = ds; //from toolbox
bindingSource1.DataMember = "person";
dataGridView1.DataSource = bindingSource1;
bindingSource1.DataMember = "person";
dataGridView1.DataSource = bindingSource1;
Comments
Post a Comment