Wednesday, February 18, 2015

Remove Raw Header in DataGridView

By default, It displays a column with star mark in the DataGridView called Row Header. In many situations this Row Header needed to removed. So,you can remove this column by changing RowHeadersVisible property into False in Properties Window.


 
You can see the Row Header in my testing form application
 Programmatically, you can do that by adding following code segment to InitializeComponent() method in Form1.Designer.cs class( In my case)
this.dataGridView1.RowHeadersVisible = false;
On the other hand, you can also select the DatagridView and Right click on it then click on Properties

Change the property of RowHeadersVisible into False in Properties Window.
Now, I will remove the Row Header from the DataGridView.
D
Do not forget to leave your comments below.

No comments:

Post a Comment