martes, 13 de julio de 2010

Cargando DropDownList con Hashtable

using System.Collections;
--


Hashtable a = new Hashtable();
Hashtable.Synchronized(a);
a.Add(-1, "SELECCIONE");

foreach (DictionaryEntry d in a)
{
  ListItem newListItem = new ListItem();
  newListItem.Text = d.Value.ToString();
  newListItem.Value = d.Key.ToString();
  this.DropDownList1.Items.Add(newListItem);
}

No hay comentarios:

Publicar un comentario