• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

Add together 2 DataGridView Cells (SUM)

Hi,

I am trying to add together (SUM) two cells in my datagridview. For this example both my cells contain "45" ...I am trying the code below, but my result is "4545" instead of "90". How can I go about getting the sum of these two cells? I am not using a Dataset behind this datagridview. Thanks!

Total = (Me.DataGridView1.Rows(0).Cells(10).Value.ToString + Me.DataGridView1.Rows(1).Cells(10).Value.ToString)
0
kasowitz
Asked:
kasowitz
1 Solution
 
Bob LearnedCommented:
You are not adding values, but concatenating strings--don't use the ToString.

Bob
0
 
kasowitzAuthor Commented:
Perfect, Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now