How to Get Total Value in DataGridview Using VB.Net

0
183

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.
  1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  2. Dim total As String = 0
  3. For i As Integer = 0 To DataGridView1.RowCount - 1
  4. total += DataGridView1.Rows(i).Cells(3).Value
  5. Next
  6. TextBox1.Text = total
  7. End Sub
  • Then Click F5 to Run the Program.

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:

 

Facebook Comments
(Visited 192 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here