Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Accessing DataGridview columns
I have a datagridview that i want to capture two of the columns and use in a calculation. When the datagridview is populated it has 4 columns. I want to
capture the contents of the 3rd and 4th columns.
When I try, I get errors. I seriously need help. Below is a copy of the code:
Dim R As Integer
Dim total As Decimal
For R = 0 To Details1.Tables(0).Rows.Count - 1
total = total + CDec(DataGrid.Item(R, 2)) * CDec(DataGrid.Item(R, 3))
txtTotal.Text = total.ToString("$##.00")