1

我正在尝试为每个出现在网格上的单个客户选择 DataGrid (gridActivePlayers) 的整个行。这是我的方法。我在使用“For Each”循环时遇到问题:

    Private Sub CustomerBindingSource_PositionChanged(sender As Object, e As EventArgs)  Handles CustomerBindingSource.PositionChanged
    Dim drvCustomer As DataRowView = CType(Me.CustomerBindingSource.Current, DataRowView)
    Dim selCustomer As Integer = drvCustomer.Item("CustomerID")

    ActivePlayersBindingSource.Position = Me.ActivePlayersBindingSource.Find("CustomerID", selCustomer)
' Here is what I need to implement
    For Each
        MsgBox(1)

    Next

End Sub
4

1 回答 1

1

来自MSDN

要以编程方式选择一行,请将其 Selected 属性设置为 true。

有关详细信息,请参阅DataGridViewRow.Selected

于 2013-05-23T23:45:19.187 回答