Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

Iam displaying all the below values in the dropdown.(table name - tbl_typecode)
ID values
2 Cold
3 Warm
4 Hot
5 Dead


In another table data is stored as below

Id name Typecode createdon
1 Raja 2 2015-07-01

I want to display the dropdown values but the default selected value is 2

How can I achieve this.

Please help
Posted

1 solution

After Bind Set the SelectedValue.
 
Share this answer
 
Comments
v2vinoth 1-Jul-15 6:02am    
Id name Typecode createdon
1 Raja null 2015-07-01

The above is the value of table..How will I set default value..bcos shows null value..
Arora_Ankit 1-Jul-15 6:14am    
So you basically want to handle null?
if yes you can insert an Item at 0 index of Dropdown after you bind it.

then if it is not null selectedValue=Value else 0.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900