Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net VB DataGrid-选中行时_Vb.net_Datagrid - Fatal编程技术网

Vb.net VB DataGrid-选中行时

Vb.net VB DataGrid-选中行时,vb.net,datagrid,Vb.net,Datagrid,我正在使用VB framework 2.0开发一个移动设备项目。DataGridView不可用-它是我正在使用的DataGrid 现在,我想知道在选中一行时如何执行某些操作。我试着这样想: Private Sub MyGrid_CurrentCellChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyGrid.CurrentCellChanged SelectedRow() End S

我正在使用VB framework 2.0开发一个移动设备项目。DataGridView不可用-它是我正在使用的DataGrid

现在,我想知道在选中一行时如何执行某些操作。我试着这样想:

Private Sub MyGrid_CurrentCellChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyGrid.CurrentCellChanged
    SelectedRow()
End Sub
Private Sub SelectedRow()
    Dim SelectedRow As Integer = MyGrid.CurrentRowIndex
    Dim numCellsSelected As Integer = 'How do i count the number of selected cells in the row above?
    If *numCellsSelected on SelectedRow* = 5 Then '5 is the number of cells
        MsgBox ("Row " & SelectedRow & " is selected!")
    End If
End Sub
我是否在正确的轨道上,和/或我如何做到这一点