How to set the title for the first column of DataGridView (RowHeaders column) in VB.NET

Viewed 74

How to give title in RowHeaders datagridview in VB.NET?

by that I mean circled the color in yellow in the screenshot below.

note : I use vb.net 2010 RowHeaders datagridview Thanks roy

1 Answers

There's a property TopLeftHeaderCell for that cell. You can use it and set the Value for the cell:

DataGridView1.TopLeftHeaderCell.Value = "Index"

enter image description here

You can also set the other properties of the cell, like its alignment, for example:

DataGridView1.TopLeftHeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
Related