Gridview attached to Drop-down

M

MasterChief

I am using a gridview and having it display what is selected in a
drop-down list. How do I set it so the gridview will show all by
default. I have added an ALL.. item to the item collection of the
drop-downlist but how do I make it so that ALL.. will display all the
items instead of select ones?
 
C

Christopher Reed

I have something similar using a RadioButtonList. I use a stored procedure
that takes a parameter that is the SelectedValue from the RadioButtonList.
In the stored procedure, I use an IF...THEN....ELSE construct where I
initially looked for the parameter value that corresponds to the "All"
category. In that portion of the IF clause, the SELECT returns all records.
In the ELSE portion of the IF clause, I use the parameter value in the WHERE
clause of the SELECT to filter the records accordingly.

This may not be the most efficient way of doing this, but works pretty well
for me.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top