How to Get Total Value in DataGridview Using VB.Net

1
1111

This tutorial is all about How to Get Total Value in DataGridview Using VB.Net. In this post i will teach you How to Get Total Value in DataGridview Using VB.Net. So let’s get started:

As a continuation of this tutorial. We will use the Displaying Data Table Records in Datagridview using VB.Net

  • First, Design your Form like this one below.
    Add a Label, Textbox, and a Button.

  • After designing the form. Click the Count Button and add this following codes.

[vbnet]

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim total As String = 0
For i As Integer = 0 To DataGridView1.RowCount – 1
total += DataGridView1.Rows(i).Cells(3).Value
Next
TextBox1.Text = total
End Sub

[/vbnet]

  • Then Click F5 to Run the Program.
  • Advertisement

Output:

 

If you have any comments or suggestions about on How to Get Total Value in DataGridview Using VB.Net, please feel free to contact our webpage.

Download How to Get Total Value in DataGridview Using VB.Net Code Here

 

Readers might read also:

 

Looking for more source code? Type your keyword here here!

1 COMMENT

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.