Josh-CO Dev

Solving the worlds problems one line of code at a time.

.NET – Filtering on a BindingSource

Leave a comment

So here is another cool trick that I picked up recently. It is incredibly simple to filter on a binding source. Using this code, you can pull all the data back into a DataGrid, other other tool, and then let the users filter the data using the binding source. Thus, you can delimit the data without making subsequent calls to the database.

Here’s the code:

BingingSource.Filter = “FieldName= “Variable + “AND FieldName2= ” + Variable2;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s