my datagrid is for user to input the debit, credit .
after input the amount , I will call an Method CalTotalDebitCredit() and it
will sum up the debit/ credit and then place
to the Total textBox. Everything works fine in 2003, BUT now, as I switch to
2005, it didn't works.
Private Sub dtGLJnDetail_ColumnChanged(.............
select case column
case 8 (Debit Side)
Me.CalTotalDebitCredit()
case 9 (Credit Side)
Me.CalTotalDebitCredit()
end select
end sub .....
prviate sub CalTotalDebitCredit
Dim numRows As Integer =
dgDetail.BindingContext(dgDetail.DataSource, dgDetail.DataMember).Count
If numRows = 0 Then Exit Sub
Dim intSeq As Integer = 0
Dim intCounter As Integer = 1
Dim decTtlDebit As Decimal = 0.0
Dim decTtlCredit As Decimal = 0.0
Dim drGLJnHeader As DataRow =
dtGLJnHeader.Rows(bmGLJnHeader.Position)
intSeq = 0
For intSeq = 0 To numRows - 1
decTtlDebit += Me.dgDetail(intSeq, 8)
decTtlCredit += Me.dgDetail(intSeq, 9)
intCounter += 1
Next
Me.txtTtlDebit.Text = decTtlDebit.ToString("#0.00")
Me.txtTtlCredit.Text = decTtlCredit.ToString("#0.00")
dgDetail.CurrentCell = New DataGridCell(intCurrentRow,
intCurrentCol)
' I had already move back the cursor in the current row, however, it
only move to the first row
end sub
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only