Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/09/2010, 13:54
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 6 meses
Puntos: 11
Respuesta: ayuda con combobox sin enlace a datos

Mejor crea un datatable con 2 columnas y se lo pasa como datasource al Combobox.

Código:
Dim dtItems as Datatable
dt.Columns.Add("id")
dt.Columns.Add("tipo")

Luego agregas filas al datatable

Dim drItem as DataRow
drItem=dt.NewRow()
drItem("id")=1
drItem("tipo")="Hotel"

dtItems.Rows.Add(drItem)

drItem=dt.NewRow()
drItem("id")=2
drItem("tipo")="Hostal"

dtItems.Rows.Add(drItem)

CmbLugar.ValueMember="id"
CmbLugar.DisplayMember="tipo"

CmbLugar.Clear()
cmbLugar.DataSource=dtItems