N
nvx
Hi,
is it possible to set different filters for two binding sources with
the same data source? If so, how? I tried to use this code:
BindingSource bindingSource1 = new BindingSource();
BindingSource bindingSource2 = new BindingSource();
bindingSource1.DataSource = myDataSet.Tables["tblname"];
dataGridView1.DataSource = bindingSource1;
dataGridView1.Columns["colname1"].DataPropertyName = "colname1db";
// etc. for every column from the DGV1
bindingSource2.DataSource = myDataSet.Tables["tblname"]; // i.e. the
same source as for the first bindingSource1
bindingSource2.Filter = "filtercol = 'value'"; // records in DGV1 are
now filtered too!
dataGridView2.DataSource = bindingSource2;
dataGridView2.Columns["colname1"].DataPropertyName = "colname1db";
// etc. for every column from the DGV2
The thing I do not understand is why is the filter applied also to the
records shown in DGV1, while the filter is set for the binding source
assigned to DGV2...
TIA
With regards
nvx
is it possible to set different filters for two binding sources with
the same data source? If so, how? I tried to use this code:
BindingSource bindingSource1 = new BindingSource();
BindingSource bindingSource2 = new BindingSource();
bindingSource1.DataSource = myDataSet.Tables["tblname"];
dataGridView1.DataSource = bindingSource1;
dataGridView1.Columns["colname1"].DataPropertyName = "colname1db";
// etc. for every column from the DGV1
bindingSource2.DataSource = myDataSet.Tables["tblname"]; // i.e. the
same source as for the first bindingSource1
bindingSource2.Filter = "filtercol = 'value'"; // records in DGV1 are
now filtered too!
dataGridView2.DataSource = bindingSource2;
dataGridView2.Columns["colname1"].DataPropertyName = "colname1db";
// etc. for every column from the DGV2
The thing I do not understand is why is the filter applied also to the
records shown in DGV1, while the filter is set for the binding source
assigned to DGV2...
TIA
With regards
nvx