Help with GridView

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
 
E

Eliyahu Goldin

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

Similar Threads

Help with my responsive home page 2
Help with code plsss 0
Help with code 0
Help with Loop 0
Help with Github??? 2
Need help with code on website (noob) 2
Need help with this code 2
Help with filtering a GridView 1

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top