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

Make column editable

Hi,

I have a GGC set up where I want to make one column editable and the rest are not. I have tried using this code:

GridTableDescriptor td = e.TableCellIdentity.DisplayElement.ParentTableDescriptor as GridTableDescriptor;
td.Columns["Price"].Appearance.AnyRecordFieldCell.ReadOnly = false;

but nothing happens. Can you please give an example of how to programmatically set specific columns to be editable.

4 Replies

AD Administrator Syncfusion Team July 5, 2007 08:12 AM UTC

Here is a sample that has a checkbox that uses the QueryCellStyleInfo event to set a particular column editable in an otherwise ReadOnly grid.


GGC_ReadOnlyColumn.zip


PC Patrick Cheng July 5, 2007 12:32 PM UTC

Hi Clay,

I;ve tried the approach you provided and it allows the cell color to change, but does not make the cell editable.

Can you think of another way for this?


AD Administrator Syncfusion Team July 5, 2007 06:50 PM UTC

The sample I uploaded does not provide an editable column 2 for you when you click the checkbox? If not, then what version of our libraries are you using? I tried the sample with 5.1.1.12 and the column become editable for me.


Another way to make a column editable is to set:

grid.TableDescriptor.Columns["ColumnName"].ReadOnly = false;




PC Patrick Cheng July 6, 2007 01:54 AM UTC

Hi Clay,

It seems that the problem was with another issue all this time. It seemed that previously in the code, the grid cells were all set to static, which caused the ReadOnly flag not to trigger. Once I took out the static code, the column I want to make editable works.

Loader.
Live Chat Icon For mobile
Up arrow icon