How to Change DataGridview Column Header text in VB.Net
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 the 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
Steps How to Change DataGridview Column Header text in VB.Net
- Step 1: First, Design your Form like this one below.
Add a Button.
- Step 2: After designing the form. Click the button and add the following codes.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
DataGridView1.Columns(3).HeaderText = "Percentage"
DataGridView1.Columns(3).DefaultCellStyle.Format = "p2"
- Step 3: Then Click F5 to Run the Program.
As you can see, from the Header Text of Price it changes to Percentage.
This tutorial is only a little portion of manipulation datagridview in visual basic. Out of this tutorial, you will be able to apply the ideas presented to your personalized vb.net projects.
If you have any comments or suggestions about How to manipulate DataGridview Column Header text using Visual Basic.Net please feel free to contact Us on Our Contact Page or simply leave a comment below.
Download code Here
For more VB.Net Projects with source code free to download you can follow this link.
If you want to learn how to master VB.NET with MySQL Database in 30 minutes, watch and follow the video here.
Or If you want a VB.Net with MS Access database version, watch it here.
Readers might read also:
- How to Get Total Value in DataGridView Using V.Net
- Displaying Data Table records in DataGridview using VB.Net
- How to load Data From DataGridVIew to TextField
- How to Load Data From MySQL Database to Table Element Using Java
- How to Used a Module in AutoSuggest and AutoAppend in VB.Net and MySQL Database