DropDown First Item

P

Paperback Writer

Hi, i have this code
cboHoraIni.DataValueField = "COD_HORARIO";
cboHoraIni.DataTextField = "DSC_HORARIO";
cboHoraIni.DataSource = objAgenda.SEL_HORARIO(); //thats a ICollection method
cboHoraIni.DataBind();
cboHoraIni.Items.Add("--Selecione um horário--");
cboHoraIni.Items[cboHoraIni.Items.Count-1].Selected=true;

But i want the item that i added manually as the first item, before the binded!

How can i do that ?

Thanks
 
B

Brock Allen

Use Insert instead of Add. Insert allows you to specify the position in the
list.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top