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

Visual Basic.NETProgramming

Avatar of undefined
Last Comment
Scott McDaniel (EE MVE )
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
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.
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo