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

cannot reset a cell''s value after previously having been set to readonly

I''m using the GridControl (4.102.0.70)

I have some code that based on some condition sets a cell to read only (style.readonly = true) in addition to setting its value to some value, say 100, all using setcellinfo with an override argument. Then something happens that I need to clear out this same cell''s value, and I do so by setting this same cell''s value to an empty string (style.cellvalue = string.empty), using setcellinfo, and passing in an override argument. The problem is that even after doing so the cell''s value is not cleared out rather it continues to display the initial value of 100. I noticed however if I do NOT initially set the cell to readonly when setting its value to 100, then later when I clear it out, it does in fact clear out. Any ideas??

Thanks

GA

2 Replies

AD Administrator Syncfusion Team August 16, 2006 04:31 PM UTC

Hi GA,

I''m not a Syncfusion developer but I recall that in order to change any properties, ReadOnly must be set to false. So you''d have to set it to false, make your changes and set it back to true.

Hope this helps!


AD Administrator Syncfusion Team August 16, 2006 04:50 PM UTC

After setting style.Readonly = true for a cell, if you want to make changes to this cell, then before making the change, you must first set grid.IgnoreReadOnly = true;


grid.IgnoreReadOnly = true; //turn off readonly
grid[row,col].CellValue = ???; //change a readonly style
grid.IgnoreReadOnly = false; //turn readonly back on

Loader.
Live Chat Icon For mobile
Up arrow icon