Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Error trying to set cell value
posted

I have a cell that I need to set the date:

e.Row.Cells["scheduled_date"].Value = schedulingDate;

When the code is executed, the following error is created:

Column 'scheduled_date' is read only.

 

I have tried the CellActivation, etc., but have not been able to figure out how to set the cell to allow me to set the date.  Thanks!

CODE:

bool ro = e.Row.Cells.IsReadOnly; //--> returns TRUE; Ok

e.Row.Cells["scheduled_date"].IgnoreRowColActivation = true;

// the e.Row.Cells["scheduled_date"].Activation value is already set to "'AllowEdit"

e.Row.Cells["scheduled_date"].Activation = Activation.AllowEdit;

ro = e.Row.Cells.IsReadOnly; // --> returns TRUE; why??

e.Row.Cells["scheduled_date"].Value = schedulingDate; // --> throws exception

Parents Reply Children
No Data