U
Uri Dimant
Hello
We use VS 2005.
I fill a data table with simple data from database (one table) which has one
column called 'flag' filtering by numbers as 1,2,3.
Now that I have all data in data table I'd like to filter it by value in
'flag' column. I have three datagrid views on my form and would like to
fill each grid with filtered data. I mean
Sub FillDataGrid (dt as datatable)
with Grid1
dt.DefaultView.RowFilter = "(TestTypeID = " & cmbTestTypes.SelectedValue & "
AND flag=1 )"
DataBindings.Clear()
..DataSource = dt.DefaultView
end with
with Grid2
dt.DefaultView.RowFilter = "(TestTypeID = " & cmbTestTypes.SelectedValue & "
AND flag=2)"
DataBindings.Clear()
..DataSource = dt.DefaultView
end with
end sub
My question is why I get for all grids the last filtered data table . I the
above case I get the data filered by FLAG=2 for Grid1 as well?
How to solve the problem?
Thank you
We use VS 2005.
I fill a data table with simple data from database (one table) which has one
column called 'flag' filtering by numbers as 1,2,3.
Now that I have all data in data table I'd like to filter it by value in
'flag' column. I have three datagrid views on my form and would like to
fill each grid with filtered data. I mean
Sub FillDataGrid (dt as datatable)
with Grid1
dt.DefaultView.RowFilter = "(TestTypeID = " & cmbTestTypes.SelectedValue & "
AND flag=1 )"
DataBindings.Clear()
..DataSource = dt.DefaultView
end with
with Grid2
dt.DefaultView.RowFilter = "(TestTypeID = " & cmbTestTypes.SelectedValue & "
AND flag=2)"
DataBindings.Clear()
..DataSource = dt.DefaultView
end with
end sub
My question is why I get for all grids the last filtered data table . I the
above case I get the data filered by FLAG=2 for Grid1 as well?
How to solve the problem?
Thank you