mercredi 20 janvier 2016

check checkbox in listview to select the row

I have a listview that displays results from a search. I want to be able to check a checkbox between each of the results and select the row in the listview.

<GridViewColumn>
       <GridViewColumn.CellTemplate>
              <DataTemplate>
                   <CheckBox x:Name="checkbox"/>
              </DataTemplate>
       </GridViewColumn.CellTemplate>
</GridViewColumn>

So far I have it working where you can select each row that you want and it will display the selections in a msgBox. Does anyone know how I could select the row when the corresponding checkbox at the end of each row is selected.

Private Sub cmdAssociatedUsers_Click(sender As Object, e As RoutedEventArgs) Handles cmdAssociatedUsers.Click

Dim allGroups As String = ""

    For Each selectedItem As Object In listPerm.SelectedItems
        allGroups &= listPerm.SelectedItems(0).xACE
    Next

    MsgBox(allGroups)
End Sub




Aucun commentaire:

Enregistrer un commentaire