DataGridView ReadOnly.

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.
 
J

Jeffrey Tan[MSFT]

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.
 
J

Jeffrey Tan[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top