CLR: .Net / Mono / Boo / Otros CLR > ASP .NET

 Recuperar datos de un checkboxlist

<< < (2/2)

pisamagu:
Hola!! x fin funciona todo, no me lo creo, bueno pongo el codigo x si acaso alguien necesita algo parecido:

Este es para mostrar los datos:
 Protected Sub checksecteur1_onload(ByVal sender As Object, ByVal e As System.EventArgs)

        Dim checksecteur As CheckBoxList = FormView1.FindControl("checksecteur1")

        Dim i, j As Integer
        Dim a As String
        Dim chainecheck1 As DataView = CType(SqlDataSource1.Select(DataSourceSelectArguments.Empty), DataView)
        a = chainecheck1(0)("secteuractivite")
        Dim opciones() As String = a.Split(";")
        For i = 0 To opciones.Length - 1
            For j = 0 To checksecteur.Items.Count - 1
                If checksecteur.Items(j).Text = opciones(i) Then
                    checksecteur.Items(j).Selected = True
                End If
            Next j
        Next i


    End Sub

Para editarlos:
    Protected Sub checksecteur2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim checksecteur As CheckBoxList = FormView1.FindControl("checksecteur2")
        Dim chainecheck As Label = FormView1.FindControl("chainecheck")
        chainecheck.Text = ""
        Dim i As Integer
        For i = 0 To checksecteur.Items.Count - 1
            If checksecteur.Items(i).Selected = True And chainecheck.Text <> "" Then
                chainecheck.Text = chainecheck.Text & ";" & checksecteur.Items(i).Text
            ElseIf checksecteur.Items(i).Selected = True And chainecheck.Text = "" Then
                chainecheck.Text = checksecteur.Items(i).Text
            End If
        Next i

    End Sub

Gracias x vuestra ayuda

dlplenin:
disculpa x no haberte contestado, acabo de ver tus mensajes

me alegro q hayas encontrado la solución

saludos

Navegación

[0] Índice de Mensajes

[*] Página Anterior

Ir a la versión completa