Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,

I want to disable a specific column so that user can't move to there. This column has to be used only for displaying result based on another columns.

Please help me.

Thanks,

Anil Kumar
Posted

1 solution

Hi,
you can set the 'readonly-property' of the column like this:
C#
dataGridView1.Columns["YourColumnName"].ReadOnly = true;
 
Share this answer
 
Comments
anil_kumar_bhakta 8-Aug-11 7:51am    
I've already set this property. but we can move there by control like TAB. I mean, the disabled column should not selected also.
`Thomas W. 8-Aug-11 7:59am    
Why is it a problem to select the column? The User cannot change the value.
Maybe its OK to select the full row and not a specific column, set the 'selectionmode' from the datagridview of 'FullRowSelect'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900