Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I'm developing windows form application, in which I'm using datagridview; which has some columns ReadOnly true and some are ReadOnly false.
And in some stage, I have to prevent user to edit datagridview, but view all rows, so in that stage I put my datagridview in ReadOnly mode.
And when changes datagridview readonly state to false; all columns are ReadOnly false.
And I Can't disable datagridview because in disable state user can't view all rows.
Thanks in advance.
Posted
Comments
Sinisa Hajnal 7-May-15 6:17am    
You loop through the columns on ReadOnly property change and change only those that are editable...or don't set the whole grid as readonly in the first place, just set those columns that were editable and shouldn't be to read only.
pravinchopade 7-May-15 8:05am    
I'm setting readonly property from common code, and passes datagridview to it.
when I set all columns to readonly, then all are same;
and again when I will set ReadOnly false for some columns; how should I know which columns to set ReadOnly. and I can not keep list of ReadOnly columns.

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