My problem is I want the Cost column to display an overall total for whatever is in the column. I have filter in place in the form of search feature. Instead of a total, it is only showing the last number in the column and the number changes according to the search as desired, but only the last number.
Here is the code in my event handler:
![Cost Total Problem.png Cost Total Problem.png](https://vbdotnetforums.com/data/attachments/2/2421-1a822637feaf869252c308c257b56556.jpg)
As you can see, the Total should be $3,040.01 and not $3,000.
Thanks for any advice.
Here is the code in my event handler:
VB.NET:
Private Sub InventoryBindingSource_PositionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InventoryBindingSource.PositionChanged, InventoryBindingSource.CurrentChanged
If Me.InventoryBindingSource.Position > -1 Then
Dim total As Double = 0
For Each column As DataRowView In Me.InventoryBindingSource.List
total = column!Cost
Next
Me.TextBox9.Text = Format(total, "c")
End If
End Sub
![Cost Total Problem.png Cost Total Problem.png](https://vbdotnetforums.com/data/attachments/2/2421-1a822637feaf869252c308c257b56556.jpg)
As you can see, the Total should be $3,040.01 and not $3,000.
Thanks for any advice.