If you've used our WinForms Data Grid in the past, you know that it ships with an unbelievable
feature set.
Our customers routinely leverage the grid's data shaping capabilities to build high-performance
user-experiences for a broad range of business scenarios.
If you've yet to experience the performance and flexibility of our WinForms Data Grid,
be sure to point your browser to devexpress.com/try to download your free 30-day trial today.
In this video, we'll show you how to use our grid's Find Panel and create apps with highly
intuitive data filtering options.
By combining the Find Panel with the grid's built-in data shaping options, summary computation
capabilities, and its printing support, you'll create a data analytics UI platform that's
second-to-none.
Before we get started, it's important to note that our grid's Find Panel offers two distinct
operational modes.
These modes are called Search and Filter.
Though the objective of both modes is the same - to make data analysis and information
filtering easy - the behavior of Search and Filter differs.
To demonstrate the difference, let's first look at Filter mode.
When in Filter Mode, our WinForms Data Grid displays results based on a specified text
string.
A quick note - The grid gives you the option to filter against all grid columns or you
can restrict search to individual columns.
We'll start by navigating to the built-in Search box at the top of the grid's container.
Let's enter "an" and see what happens.
As you can see, the grid automatically filters the records displayed within the grid to those
rows that contain a record with "an."
Since we are filtering against all columns in the grid, the "an" string combination need
only appear in a single column -- though in this example "an" appears within multiple
columns.
Let's now take look at a different usage scenario.
Assume we want to find records in our dataset that contains "Germany" within the Country
column.
We'll go ahead preface the search string with the column name - in this case country.
Next, we'll enter a colon, then type Germany in our Search box and we'll press Find.
As you can see, the grid now filters for Germany using values stored in the country column.
Very cool.
Let's keep going.
What if we wanted to add a second filter condition to our previous search.
Assume I want to keep my initial search of country equals "Germany," but now I wish to
add "Berlin" to my search string.
I could do this in two ways - I can simply add "Berlin" to the end of my original search
string or I can preface "Berlin" with the column name - in this case City.
It doesn't stop there.
The DevExpress WinForms Grid allows us to do the opposite quite easily.
Instead of searching for "Berlin," we could ask the grid to look for all cities in "Germany"
except for "Berlin."
This is done by entering a minus symbol before the City column.
As you can see, once we entered the minus symbol before the City column, the grid displays
all cities within "Germany" - excluding the record in Berlin.
Remember, this is all built-in functionality.
You don't have to write a single line of code to enable this advanced capability in your
desktop app.
And you have numerous ways to customize our Find Panel - simply navigate to docs.devexpress.com
to learn more about our grid's filtering options and how you can deliver the best possible
search experience to your customers.
OK - now that we've given you a basic overview of Filter Mode, let's take a look at our relatively
new Search Mode.
Before we get into it, a quick explanation of Search Mode.
Search mode was designed to mirror Search in modern browsers like Chrome and Opera.
Instead of "filtering-out" data, Search mode highlights located records within the dataset
--- it does not filter out rows within the grid.
This behavior is akin to a browser.
If you load a webpage, you can use the browser's find feature to search for specific words
or text string.
The browser highlights those words on the page, but it does not remove all non-matching
words/text from the webpage.
Step one in this portion of our tutorial is to change the find behavior of this demo to
Search.
We'll do this by using the Behavior combo box on the right side of the demo.
Now Let's use the string from our previous example.
We'll enter "an" in the Search field and press Enter.
As you can see, the grid does not filter out any rows.
The total number of records displayed on screen remains the same.
Highlighting is similar to the Filter Mode - Search Mode highlights all matching values
within all grid columns.
Again, the only difference between the two at this point is that Filter Mode removed
non-matching rows and Search retains all rows and only highlights matching values.
But that's the tip of the iceberg when it comes to the power of our grid's Search Mode.
Let's take a deeper look and explain the advantages of this option.
The grid contains a total of 91 records.
Note the Search box we used to initiate our search.
Notice that it has changed.
It now displays the number of records that match the search criteria - in this instance,
74 records contain "an" in one or more columns.
If you look at the scrollbar, you'll notice that our WinForms Grid displays the actual
location of records.
These orange markers tell users where they can scroll in order to reach the next located
record.
This demo has a limited number of records within it, but imagine if your grid contains
a thousand rows.
In such an instance, these orange markers will allow users to "drill" to the right location
via the scrollbar without being forced to randomly navigate all one thousand records.
These markers also give you a way to introduce ad-hoc analytics into any app - by using Search
Mode, users can compare total records versus those records that match a specific search
condition.
Also note that the Find Panel now includes two command buttons.
These buttons allow users to navigate through the result set.
Users can also navigate results via the keyboard.
The keyboard shortcut to move to the next record is F3.
Here we're pressing the F3 key to jump to the next search result.
And Shift F3 moves backwards in the search result set.
Now, let's take a look at what happens if we want to highlight records that contain
"Berlin."
We'll enter "Berlin" in the Find Panel and as you can see, the grid highlights the single
record in our list.
Let's change our search to "Germany."
This time, we'll preface the search string with the column name.
Note that we have 11 matches for the search string "Germany" against the Country column.
We can navigate through the list by using the Find Panels command buttons or the keyboard.
Results for this search are also visible on the scrollbar via orange markers.
We call these markers Scrollbar Annotations.
Scrollbar Annotations are an unbelievably powerful option that we'll detail in a future
video.
If you're wondering - yes, Scrollbar Annotations allow you to include custom information so
you can make record navigation and data access super-intuitive for your end-users.
For instance, you could highlight important records within the scrollbar, allow users
to bookmark records for future access, or point users to errors so they can drill down
without unnecessary hassles or aggravation.
Before we wrap up, let's cover a few basics about the Find Panel.
We give you a few different ways to display the Find Panel.
To invoke the Find Panel if it's not visible on-screen, you can simply use the CTRL + F
key combination.
You can also press the spyglass icon in the data grouping panel.
If the Find Panel is visible, you can hide it by pressing the close button to the left
of the Search box or press ESC on your keyboard when the Find Panel has focus.
We give you a couple of display options when using the Find Panel.
As you've seen, the Find Panel can be displayed within the data grouping pane or you have
the option to display it at the top of the grid's container.
The Find Panel's display position is entirely up to you.
To learn more about all Find Panel customization options, please be sure to visit our website
- a link to product documentation is included in this video's description field.
I hope you've enjoyed this introductory tutorial on the DevExpress WinForms Grid Find Panel.
If you liked this video, please give us a thumbs up.
If you have questions, please comment below.
Please remember to subscribe to this channel for more great DevExpress training videos.