Ask the Expert

Using entered data as criteria to limit results returned

I have created a data grid that is returning the complete table. Now I'm looking for an example of how I could use the data a user would type in a Web form field as the criteria to limit what is returned. I'm not using a dataset. Thanks in advance for your help.
I would transform the data from the grid into a memory resident DataTable. Then I would filter the data with the value from the form field by setting the RowFilter property of the DefaultView object of the DataTable and repopulate the grid with the results.

Another approach would be to iterate the rows of the grid and based on the form field value hide those rows that do not meet the filter criteria.

This was first published in October 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: