Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i do bind data to adropdownlist
and i want show details by select a item of this dropdownlist
but when is page load first item is first row of my table
i dont have accour this
i want show me null value ,in first row of dropdownlist on the page load
Posted

1 solution

Follow the below code

SQL
dropList1.Items.Insert(0, new ListItem(String.Empty, String.Empty));
dropList1.SelectedIndex = 0;



make it answer if this is your solution. dont forget to rate the solution.


Thanks
 
Share this answer
 
Comments
sadegh_rusta 30-Jun-12 14:00pm    
where i do type this code?before bind my data to dropdown or after...?
AshishChaudha 30-Jun-12 14:02pm    
after bind of the dropdownlist. syntax already saying insert me

dropList1.Items.Insert()
sadegh_rusta 30-Jun-12 14:13pm    
rating is 5
AshishChaudha 30-Jun-12 14:16pm    
thanx

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