my code stock.com

CHECA SI ESTA ACTIVADO O NO EL CHKLIST SELECCIONADO

ADICIONA UN RENGLON AL GRID
ELIMINA UN RENGLON DEL GRID

Snippet options

Download: Download snippet as datagridview.txt.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

Private Sub ChkList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChkList.SelectedIndexChanged
        Dim Nom As String
        Dim i As Integer
        If ChkList.GetItemChecked(ChkList.SelectedIndex) = True Then
            'ASIGNA AL GRID A LA PERSONA SELECCIONADA
            Nom = ChkList.SelectedItem
            DatosCom(Nom)
            With DataGrid1
                .Rows.Add(Comisionados.Id, Comisionados.Nom, "", Comisionados.Tipo)
            End With
        Else
            'ELIMINA DEL GRID LA PERSONA QUE SE ESTA DESMARCANDO
            With DataGrid1
                For i = 0 To .Rows.Count - 1
                    If .Rows(i).Cells(1).Value = ChkList.SelectedItem Then
                        .Rows.RemoveAt(i)
                        Exit For
                    End If
                Next
            End With

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.