Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.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 当datagrid组合框上的值发生变化时,执行该过程_Vb.net_Datagrid - Fatal编程技术网

Vb.net 当datagrid组合框上的值发生变化时,执行该过程

Vb.net 当datagrid组合框上的值发生变化时,执行该过程,vb.net,datagrid,Vb.net,Datagrid,我有一个数据网格,里面有一个组合框。每当组合框上的值更改时,我希望执行以下过程: Dim dblQty As Double Dim dblPrice As Double For index As Integer = 0 To grdNewInvoice.RowCount - 1 dblQty = Convert.ToDouble(grdNewInvoice.Rows(index).Cells(1).Value) dblPrice = Conv

我有一个数据网格,里面有一个组合框。每当组合框上的值更改时,我希望执行以下过程:

Dim dblQty As Double
    Dim dblPrice As Double


    For index As Integer = 0 To grdNewInvoice.RowCount - 1

        dblQty = Convert.ToDouble(grdNewInvoice.Rows(index).Cells(1).Value)
        dblPrice = Convert.ToDouble(grdNewInvoice.Rows(index).Cells(2).Value)

        grdNewInvoice.Rows(index).Cells(3).Value = dblPrice * dblQty

    Next

    Dim dblTotal As Double = 0

    For i As Integer = 0 To grdNewInvoice.RowCount - 1
        If grdNewInvoice.Rows(i).Cells(2).Value IsNot "" Then
            dblTotal += CDbl(grdNewInvoice.Rows(i).Cells(3).Value)
        End If
    Next

    lblTotal.Text = dblTotal.ToString("C")

End Sub

我尝试过不同的事件:CellEndEdit、CellContentClick,但都不适合我。我可以使用什么事件。

CurrentCellDirtyStateChanged