Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/03/2011, 11:06
Avatar de Aquaventus
Aquaventus
 
Fecha de Ingreso: junio-2010
Ubicación: Lima-Peru , En el alba de la naturaleza
Mensajes: 2.105
Antigüedad: 14 años, 9 meses
Puntos: 267
Respuesta: Duda con checkboxlist

Hola ivelazquez prueba... :

Código vb.net:
Ver original
  1. Dim i As Integer
  2.     Dim x as integer
  3.             'PASO EL DATATABLE QUE ESTA LLENO DE TUS DATOS DE TODOS LOS ROLES(TABLA ROLES)
  4.         CheckBoxList1.DataSource = TudataTable
  5.         'RECORRES TU DATATABLE QUE TRAE TODOS LOS ROLES(TABLA ROLES)
  6.         For i = 0 To datatable1.rows.count - 1
  7.             'RECORRES TU DATATABLE QUE TRAE LOS ROLES DE UN USUARIO(USUARIOS_ROLES)
  8.             For x = 0 To datatable2.rows.count - 1
  9.                 'COMPARAS SI SON IGUALES LOS CODIGOS PARA SELECCIONARLOS
  10.                 If datatable1.rows(i).Item(0).toString().Equals(datatable2.rows(x).Item(1).toString()) Then
  11.                     CheckBoxList.Items(x).Selected = True
  12.                 End If
  13.  
  14.             Next x
  15.         Next i

Espero te haya aclarado un poco el panorama... Saludos!
__________________
Internet es tener todo el conocimiento global a tu disposición.
Desarrollo de Software - Ejemplos .Net