We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

readOnly columns

I want to be able to togle the readOnly property for particular columns in the gridControl. I initialize the colStyles readOnly property for the columns according to some meta-data. Let''s say the first 2 cols are readOnly and the second 2 are not in a 4 column grid. I have a checkBox that I want to use to togle the columnStyle readOnly property for the last 2 cols (non-readOnly according to the meta_data). Everything is fine when the form first loads. Cols 1&2 are readOnly and cols 3&4 are not. Everything is fine when I (togle) set cols 3&4 to readOnly. However when I try to set cols 3&4 back to readOnly ''= false'' it doesn''t work. What am I doing wrong? I am using v2.0.5.1

4 Replies

AD Administrator Syncfusion Team February 12, 2005 03:37 PM UTC

To change styles that have been set to ReadOnly, you first must set grid.IgnoreReadOnly = true, then change the styles, then reset the grid.IgnoreReadOnly back to false.


JR Joseph Rezuke February 13, 2005 12:36 AM UTC

Thanks Clay, that did it.


AD Administrator Syncfusion Team May 18, 2006 08:28 AM UTC

Can I ask why it is like this?! This took me about 3 hours to find out. ReadOnly for me and many others concerns manual input from the keyboard not programatically changes. Im sorry to say, this is stupid, maby my anger will settle if I get a good explanation. >To change styles that have been set to ReadOnly, you first must set grid.IgnoreReadOnly = true, then change the styles, then reset the grid.IgnoreReadOnly back to false.


AD Administrator Syncfusion Team May 18, 2006 08:40 AM UTC

Hi Jonas, Setting a cell as ReadOnly also makes it ReadOnly for programmatic changes too. Please refer to the following link to know more on setting properties for the ReadOnly cells. How to set style properties for Read-Only cells in Grid? Let us know if you have any further queries. Regards, Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon