G
Guest
I was under the impression that you could use data views to have multiple
sorts and filters on a dataset or data table. I want to bind two different
combo boxes to different data views for a single table. I set the row filter
for the first data view and bind the view to the combo box, I then set the
row filter for the second view and bind it to the second combo box. Both
combo boxes display the last row filter applied to the data set even though
they were bound to different views? I think I am missing something.
ToDV = addresses_DS.Tables["Customer_Address_MSTR"].DefaultView;
ToDV.RowFilter = "TypeID = 'To'";
ToDV.Sort = "NameID";
toName.DataBindings.Clear();
toName.DataSource = ToDV;
toName.DisplayMember = "NameID";
toName.ValueMember = "NameID";
toName.SelectedItem = null;
FromDV = addresses_DS.Tables["Customer_Address_MSTR"].DefaultView;
FromDV.RowFilter = "TypeID = 'From'";
FromDV.Sort = "NameID";
fromName.DataBindings.Clear();
fromName.DataSource = FromDV;
fromName.DisplayMember = "NameID";
fromName.ValueMember = "NameID";
fromName.SelectedItem = null;
sorts and filters on a dataset or data table. I want to bind two different
combo boxes to different data views for a single table. I set the row filter
for the first data view and bind the view to the combo box, I then set the
row filter for the second view and bind it to the second combo box. Both
combo boxes display the last row filter applied to the data set even though
they were bound to different views? I think I am missing something.
ToDV = addresses_DS.Tables["Customer_Address_MSTR"].DefaultView;
ToDV.RowFilter = "TypeID = 'To'";
ToDV.Sort = "NameID";
toName.DataBindings.Clear();
toName.DataSource = ToDV;
toName.DisplayMember = "NameID";
toName.ValueMember = "NameID";
toName.SelectedItem = null;
FromDV = addresses_DS.Tables["Customer_Address_MSTR"].DefaultView;
FromDV.RowFilter = "TypeID = 'From'";
FromDV.Sort = "NameID";
fromName.DataBindings.Clear();
fromName.DataSource = FromDV;
fromName.DisplayMember = "NameID";
fromName.ValueMember = "NameID";
fromName.SelectedItem = null;