dataview.datasource not binding or updating datagrid

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Dim dv As DataView = New DataView
(DataSet11.Tables("InventoryTable"))

dv.RowFilter = "ItemAuthor LIKE '" &
ItemAuthor.Text & "%'"
dv.RowStateFilter =
DataViewRowState.ModifiedCurrent
dv.Sort = "ItemID"
Dim temp As Integer = dv.Count()


DataGrid1.DataSource = dv

DataGrid1.DataBind()


when i compile this code my dim temp integer is 2 meaning
that my select statement is getting data from the primary
table. When i go to fill this datagrid i still get 4
items which is what was contained before the dataview was
created. Any help would be great.. thank you.. Ben
 
Hi Ben
That code is putting a filter on the view where the ItemAutor in the table
is Like the textbox text AND the row state is Modified Current so are you
sure you have data that meets those requirements. If you just want the rows
to be filtered like the author then comment out the rowstate filter as i
guess this is your problem or at least change it to modified rows

Mark
 
Back
Top