DataGridView AutoFilter

Excel Filtering in DataGridView

The Scrolling Horror!!
The Scrolling Horror!!

Have no fear, DataGridView AutoFilter is here

Really Old is Gold!

Source: Official NuGet Logo
Source: Official NuGet Logo
Snapshot from Microsoft's Offcial Documentation
Snapshot from Microsoft's Official Documentation
Show Records Having Rank Equal To 1
Show Records Having Rank Equal To 1

What’s The Solution?

Form with multi-language options
Form with multi-language options

How To Get Started?

Let’s Begin!

Step 1 : Create a new project
Creating Visual Studio Project
Creating Visual Studio Project
Step 2: Download NuGet Packages
Getting the NuGet Packages
Getting the NuGet Packages
Step 3: Designing the User Interface
DataGridView Drag ’N’ Drop
DataGridView Drag ’N’ Drop
StatusStrip Drag ’N’ Drop
StatusStrip Drag ’N’ Drop
Renaming ToolStripStatusLabels
Renaming ToolStripStatusLabels
Setting FilterStatusLabel Properties
Setting FilterStatusLabel Properties
Setting ShowAllLabel Properties
Setting ShowAllLabel Properties
Placing StatusStrip Beneath DataGridView
Placing StatusStrip Beneath DataGridView
Step 4: Constructing the Person Model
Constructing Person Model
Constructing Person Model
Building Person Model
Building Person Model
Step 5: Assigning DataGridView Data Source
Assigning Data Source to DataGridView
Assigning Data Source to DataGridView
Step 6: Manipulating the Columns
Filling up the column header
Filling up the column header
Renaming the columns
Renaming the columns

3. Set the ColumnType of each column from DataGridViewTextBoxColumn to DataGridViewAutoFilterTextBoxColumn.

Changing the column types
Changing the column types
Step 7: Coding

1. Create a private object of the Person class and a private list of type Person.

2. Select the Load event from the Form1 Events List & paste the code.

4. Select the Click event from the ShowAllLabel Events list & paste the code.

5. Select the DataBindingComplete event from the DataGridView Events list & paste the code.

Hurrah! We're Done

Source Code

THE END?

Not at all! Join us now and make contributions to the library by visiting the DataGridViewAutoFilter⁷ GitHub repository. Demo forms with different look and feel have been generated using the same technique which can be seen below.

basic Look and Feel
Basic Look and Feel
Metro Look & Feel
Metro Look & Feel
Material Look & Feel
Material Look & Feel

REFERENCES

Leave a Reply

Your email address will not be published. Required fields are marked *