Tuesday 21 May 2013

How to: Hide Column Headers in the Windows Forms DataGridView Control ?





Sometimes you will want to display a DataGridView without column headers. In the DataGridView control, the ColumnHeadersVisible property value determines whether the column headers are displayed.



To hide the column headers

  • Set the System.Windows.Forms.DataGridView.ColumnHeadersVisible property to false.

    dataGridView1.ColumnHeadersVisible = false
    
    
    //this line of code will hide the ColumnHeaders from gridview.


0 comments:

Post a Comment