Windows Develop Bookmark and Share   
 index > Windows Forms General > DataGridView -- Hiding The Leftmost Column
 

DataGridView -- Hiding The Leftmost Column

Dear all,

I have anappthat usesa data-grid-view just in order to display information to its users. Therefore users aren't allowed to add columns, nor to update any field. For this reason, the leftmost column (which is automatically created, and where * appearsfor new rows) isn't required, and just acquires place on the screen. Iwant to hide this column, but find no way to do so.

Do you know how can I hide this column?

Thanks,

Ofer.

Ofer Elboher  Monday, January 21, 2008 10:55 AM

Set the datagridview's AllowUserToAddRows and AllowUserToDeleteRows properties to false.

Regards,

Fábio

Edit:

And to completely hide the entire leftmost column (Called RowHeader) you set the RowHeadersVisible property to False.

Fábio Franco  Monday, January 21, 2008 11:35 AM

Set the datagridview's AllowUserToAddRows and AllowUserToDeleteRows properties to false.

Regards,

Fábio

Edit:

And to completely hide the entire leftmost column (Called RowHeader) you set the RowHeadersVisible property to False.

Fábio Franco  Monday, January 21, 2008 11:35 AM

Thanks, Fabio, for your help - that did the job.

Sincerely,

Ofer.

Ofer Elboher  Monday, January 21, 2008 12:29 PM

You can use google to search for other answers

Custom Search

More Threads

• form invisible and controls/graphics shown. Possible?
• SampleDesignerHost issue.
• DrawImage stretching problem on Non Client drawing
• Multiple icons on listview
• Gridview cell value to combo box
• Validating parameters
• How to view/edit a PDF file inside a .NET application
• Message Box
• How to have only one checkbox checked in a checked listview
• Custom Control not updating