Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Load combos

Reply
Thread Tools

Load combos

 
 
=?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=
Guest
Posts: n/a
 
      06-07-2007
Hello,

I have a list of entities (with properties Key and Description).

Which is the best manner of load dropdownlist with this list ?

1.

ListaTiposInmueble tiposInmueble = bfll.ObtenerListaTiposInmueble();
foreach (TipoInmuebleEntidad tipoInmueble in
tiposInmueble.TiposInmueble.Values)
{
this.ddlTipoInmueble.Items.Add(new
ListItem(tipoInmueble.Fcitem, tipoInmueble.Valor.ToString()));
}

2.

//ListaTiposInmueble tiposInmueble =
bfll.ObtenerListaTiposInmueble();
//if (tiposInmueble != null)
//{
// this.ddlTipoInmueble.Items.Clear();
// this.ddlTipoInmueble.DataSource =
tiposInmueble.Elementos.Values;
// this.ddlTipoInmueble.DataTextField = "Fcitem";
// this.ddlTipoInmueble.DataValueField = "Valor";
// this.ddlTipoInmueble.DataBind();
//}

Thanks in advance

--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-07-2007
2.

In many cases you can also do it in .aspx page without codebehind.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Alhambra Eidos Kiquenet" <(E-Mail Removed) >
wrote in message news:(E-Mail Removed)...
> Hello,
>
> I have a list of entities (with properties Key and Description).
>
> Which is the best manner of load dropdownlist with this list ?
>
> 1.
>
> ListaTiposInmueble tiposInmueble = bfll.ObtenerListaTiposInmueble();
> foreach (TipoInmuebleEntidad tipoInmueble in
> tiposInmueble.TiposInmueble.Values)
> {
> this.ddlTipoInmueble.Items.Add(new
> ListItem(tipoInmueble.Fcitem, tipoInmueble.Valor.ToString()));
> }
>
> 2.
>
> //ListaTiposInmueble tiposInmueble =
> bfll.ObtenerListaTiposInmueble();
> //if (tiposInmueble != null)
> //{
> // this.ddlTipoInmueble.Items.Clear();
> // this.ddlTipoInmueble.DataSource =
> tiposInmueble.Elementos.Values;
> // this.ddlTipoInmueble.DataTextField = "Fcitem";
> // this.ddlTipoInmueble.DataValueField = "Valor";
> // this.ddlTipoInmueble.DataBind();
> //}
>
> Thanks in advance
>
> --
> http://www.alhambra-eidos.es/web2005/index.html
> www.kiquenet.net
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DVD/VCR combos any good? TissuePaper DVD Video 6 02-23-2007 10:58 PM
Are there any good HD recorder / DVD recorder combos? GeorgeK DVD Video 0 06-13-2006 09:49 PM
DVD/VCR Combos Tom DVD Video 0 10-02-2005 10:44 PM
ULTRA cheap DVD combos RichA DVD Video 3 03-16-2005 01:35 AM
Newbie Question: DVD-VCR Combos Cristoir DVD Video 11 12-22-2004 08:04 PM



Advertisments