dear all,
I am very new to vb.net 2. This is my post to this site. I have some
doubts in Datagridview.
I am using datagridview in unbound mode. in datagridview i have 4
coloumns
product qty price amount
product coloumn is a combo box and others textbox. now when i enter
leave qty or price i want the amount to be calculated and displayed
automatically. below is the code which i used
but when leaving the price coloumn the amount is not calculating. if i
back to qty and pressing tab again it is calculating
code..
Private Sub DataGridView1_C ellLeave(ByVal sender As Object, ByVal e As
System.Windows. Forms.DataGridV iewCellEventArg s) Handles
DataGridView1.C ellLeave
If (TypeOf CType(sender,
Windows.Forms.D ataGridView).Ed itingControl Is
DataGridViewCom boBoxEditingCon trol) Then
DataGridView1.E ditingPanel.Sel ect()
End If
If e.ColumnIndex = 1 Or e.ColumnIndex = 2 Then
DataGridView1.R ows(e.RowIndex) .Cells(3).Value =
CType(DataGridV iew1.Rows(e.Row Index).Cells(1) .Value *
DataGridView1.R ows(e.RowIndex) .Cells(2).Value , Double)
End If
End Sub
can anybody help me in this ...
thanks
I am very new to vb.net 2. This is my post to this site. I have some
doubts in Datagridview.
I am using datagridview in unbound mode. in datagridview i have 4
coloumns
product qty price amount
product coloumn is a combo box and others textbox. now when i enter
leave qty or price i want the amount to be calculated and displayed
automatically. below is the code which i used
but when leaving the price coloumn the amount is not calculating. if i
back to qty and pressing tab again it is calculating
code..
Private Sub DataGridView1_C ellLeave(ByVal sender As Object, ByVal e As
System.Windows. Forms.DataGridV iewCellEventArg s) Handles
DataGridView1.C ellLeave
If (TypeOf CType(sender,
Windows.Forms.D ataGridView).Ed itingControl Is
DataGridViewCom boBoxEditingCon trol) Then
DataGridView1.E ditingPanel.Sel ect()
End If
If e.ColumnIndex = 1 Or e.ColumnIndex = 2 Then
DataGridView1.R ows(e.RowIndex) .Cells(3).Value =
CType(DataGridV iew1.Rows(e.Row Index).Cells(1) .Value *
DataGridView1.R ows(e.RowIndex) .Cells(2).Value , Double)
End If
End Sub
can anybody help me in this ...
thanks
Comment