Help with GridView

  • Thread starter Thread starter nomad
  • Start date Start date
N

nomad

Hi,

I have a grid which has a datasource of a table in my database. I
want to be able to filter it based on what someone selects from either
an option or a text box. If they select from an option it will look
at all records for that day, if the text box it will look for all
records within the last x minutes. Is this possible to do?

Appreciate any help on this
 
You can filter either in the database select statement or on the DataTable
object that contains the data loaded from the database. In the former case
you may want to use SqlDataSource control with some ControlParameters. In
the latter case you will need to load data first into a DataTable, then
create a DataView with your filtering conditions and to databind the grid to
the DataView. The first approach is simpler to implement.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top