dataview.datasource not binding or updating datagrid

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
 
M

Mark

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Data Grid NOT SORTING 16
Why oh why doesn't my data view work? 1
Bindind a dataset ??? 2
filter & datagrid 1
Sorting of datagrid column 2
DataGrid Sorting does not work 1
Datagrid won't sort 7
Binding to a datagrid 2

Top