Home All Groups Group Topic Archive Search About
Author
10 Jun 2005 8:23 PM
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


Author
10 Jun 2005 8:34 PM
Brock Allen
Use Insert instead of Add. Insert allows you to specify the position in the
list.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
>

Bookmark and Share