dropdownlists last value

liunx

Guest
I fill dropdown lists values from the database then I wants to hard code first value and last value. I already hard code first value it's like this.

cboName.Items.Insert(0,new ListItem("----Select----","0"));

how can I hard code last value of the dropdown list, I want to add last value as a ----Other----. can anyone help me?
Thanks.Can't you just do it after adding all the values?

like this:

cboName.Items.Insert(0,new ListItem("----Select----","0"));
//loop to add values from your datasource
cboName.Items.Insert(0,new ListItem("----Other----","Other"));can't becase last value will vary,
I found the solution here it is,

count = cboDrop.Items.count
cboDrop.Items.Insert(count, New ListItem("-----other-----", count.ToString()))

Thanks for you reply. :mad:
 
Back
Top