In a grid, I need to manually recalculate two other columns after manually changing one column.
how can you do it in vb.net
my code is
Private Sub Grelha_TableControlCurrentCellValidated(sender As Object, e As GridTableControlEventArgs) Handles Grelha.TableControlCurrentCellValidated
Dim dComissaoEmpresa As Double = 0
Select Case ccTipo
Case tipo.Agentes
' CELULA ONDE ESTOU
Dim currentCell As GridCurrentCell = Me.Grelha.TableControl.CurrentCell
Dim tableCellStyle As GridTableCellStyleInfo = e.TableControl.GetTableViewStyleInfo(currentCell.RowIndex, currentCell.ColIndex)
If Not IsNothing(tableCellStyle.TableCellIdentity.Column) Then
Dim r As Record = Grelha.Table.CurrentRecord
Select Case tableCellStyle.TableCellIdentity.Column.Name
Case "Perc." ' - nome da coluna em que estou
Dim dPerc As Double = r.GetValue("Perc.") -> that's my problem. it brings the old value not the value that i put in the column
dComissaoEmpresa = r.GetValue("Com. Empresa")
r.SetValue("Vl. Comissão", dComissaoEmpresa * dPerc / 100)
r.SetValue("Vl.Restante", dComissaoEmpresa - (dComissaoEmpresa * dPerc / 100))
Case "Vl. Comissão" '
Case "Vl.Restante"
Case Else
End Select
End If
Case Else
End Select
End Sub
End Class