select *

  • Thread starter Thread starter Mr. SweatyFinger
  • Start date Start date
M

Mr. SweatyFinger

I can not get a real answer to this question. Can you help?

I have a gridview and a sqlserver datasource.
I also have a dropdownlist of countries.

The gridview displays a bunch of crap about whatever country is selected in
the countries dropdownlist

I want to add a selection "ALL COUNTRIES"

but what would its value be?

What would it's value be to cause the select statement to choose "ALL
COUNTRIES"?

thank you

(also, please don't answer this question unless you are answering this
question, you will see why soon)
 
Just change the AppendDataBoundItems property of the DDL to 'True' - then,
add your item to the DDL ("All Countries"), making the value 0 or whatever
you want - the rest of the answer depends on how you're using the DDL in
your query (value or text)
 
You could dummy up an "ALL COUNTRIES" entry by modifying your Sql like so:

SELECT "ALL", -1

UNION ALL

SELECT CountryName, CountryId
FROM Country

If you take action based on the selected country, then you will need to
modify your code to watch for -1 ie ALL COUNTRIES and take appropriate
action.

Hope I have Helped.

--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
 
where do i do that?

Just change the AppendDataBoundItems property of the DDL to 'True'


are you sure you are answering my question?
Really sure?
 
Back
Top