How to Change DataGridview Column Header text in VB.Net

0
98

This tutorial is all about How to Change DataGridview Column Header text in VB.Net. In this post i will teach you How to Change DataGridview Column Header text in VB.Net. So let’s get started:

As a continuation of this tutorial. We will use the How to Format the DataGridview Column to Percentage using VB.Net

 

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

  • After designing the form. Click the 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. DataGridView1.Columns(3).HeaderText = "Percentage"
  3. DataGridView1.Columns(3).DefaultCellStyle.Format = "p2"
  4. DataGridView1.Refresh()
  5. End Sub

 

  • Then Click F5 to Run the Program.

Output:

As you can see, from the Header Text of Price it changes to Percentage.

 

If you have any comments or suggestions about on How to Change DataGridview Column Header text in VB.Net please feel free to contact Us on Our Contact Page.

 

Download Code Here

 

Readers might read also:

Facebook Comments
(Visited 108 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here