M
Murali
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_CellLeave(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellLeave
If (TypeOf CType(sender,
Windows.Forms.DataGridView).EditingControl Is
DataGridViewComboBoxEditingControl) Then
DataGridView1.EditingPanel.Select()
End If
If e.ColumnIndex = 1 Or e.ColumnIndex = 2 Then
DataGridView1.Rows(e.RowIndex).Cells(3).Value =
CType(DataGridView1.Rows(e.RowIndex).Cells(1).Value *
DataGridView1.Rows(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_CellLeave(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellLeave
If (TypeOf CType(sender,
Windows.Forms.DataGridView).EditingControl Is
DataGridViewComboBoxEditingControl) Then
DataGridView1.EditingPanel.Select()
End If
If e.ColumnIndex = 1 Or e.ColumnIndex = 2 Then
DataGridView1.Rows(e.RowIndex).Cells(3).Value =
CType(DataGridView1.Rows(e.RowIndex).Cells(1).Value *
DataGridView1.Rows(e.RowIndex).Cells(2).Value, Double)
End If
End Sub
can anybody help me in this ...
thanks