DataGridView ReadOnly.

  • Thread starter Thread starter Goh
  • Start date Start date
G

Goh

Dear all,

I got a question regarding to DataGridView. I would like to
invisible the first column that been generated by the DataGridView. This
columns is to help user to know the status of the row like new or edit.

my DataGridView only consist of data from database and a custom
columns that without binding. I dun need any insert or edit function in my
DataGridView. That why I dun think the first columns should visible.

How can I hide this columns? Do I have any component that can be use
for data rows display?


Thanks in advance for any kind of suggestion and help.
 
Hi Goh,

Thanks for your post.

Based on my understanding, you want to hide certain columns in
DataGridView. I assume the columns in the DataGridView are autogenerated by
winform databinding, yes? Then we can hide certain column with the code
below:
dataGridView1.Columns["CustomerID"].Visible = false;

For more information, please refer to the link below:
"How to: Remove Autogenerated Columns from a Windows Forms DataGridView
Control"
http://msdn2.microsoft.com/en-us/library/hbtwc35f.aspx

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi,

Does my reply make sense to you? Is your problem resolved? Please feel free
to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top