Link to home
Start Free TrialLog in
Avatar of Bob Valentine
Bob ValentineFlag for United States of America

asked on

How do I filter a DataGridView?

I have a form with a Datagridview on it and I need to filter it on a field called BulkSaleNumber. I need help with the statement to filter the Datagridview for all records where the BulkSaleNumber =0. How do I filter the Datagridview so that it will list only those rows where the BulkSaleNumber =0?. Please see my code below.


    
        Private Sub frmBulkSale_Load(sender As Object, e As EventArgs) Handles MyBase.Load
             'TODO: This line of code loads data into the 'AssetDatabaseDataSet.tblAssetData' table. You can move, or remove it, as needed.
              Me.TblAssetDataTableAdapter.Fill(Me.AssetDatabaseDataSet.tblAssetData)
        End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, if possible you would prefer to filter the data before it hits the Datagridview. I don't know how you're loading the dataset/datatable that is used for the DGV so it's hard to give direct advice on that.