I am trying to edit the value of a cell in an UltraGridGroupByRow. It was working fine in 2008.1. I recently upgraded the project to 2010.1 and this was one of the few things that broke compatability. I need a little help getting it working again.
The existing code that stopped working: groupByRow.Cells["Key"].Value = "Test Value";
I also tried: groupByRow.Cells["Key"].SetValue("Test Value", false);
I get the same error no matter what I do. That error is: "Column 'Key' is read only".
Does anyone know of a work around?
Thanks.
Hi,
As far as I know, the GroupByRow doesn't even have a cells collection. So I don't see how this code could ever have worked. Attempting to reference the Cells collection on a GroupByRow will result in a NullReferenceException. The Cells property is hidden from Intellisense and always returns null.
You're right, it is a normal UltraGridRow. Is there a way to set the value of a cell on a normal row in 2010.1? Nothing I am trying is working.
Nothing has changed since 2008.1.
As you can see above I have tried .Value = value (original code), .SetValue(), and changing the Activation of the cell, row, and band to Activation.AllowEdit. Everything I do results in a Read only error.
I am not the original author of the code. I am just tasked with swapping the DLLs from 8.1 to 10.1 in the references. There were only 2 of our assemblies that broke due to broken comparability out of about 70. They both are due to this read only error from trying to change a cell value in a grid.
I thought it would be an easy fix, but I am stumped.
Here is the original code:
foreach (UltraGridRow row in ultraGridBatch.Rows) { UltraGridGroupByRow rowGroup; if (row.IsGroupByRow) { rowGroup = (UltraGridGroupByRow)row; rowGroup.Description = rowGroup.Value.ToString(); groupByRows = rowGroup.Rows; foreach (UltraGridRow groupRow in groupByRows) groupRow.Cells["User Name"].Value = Convert.ToInt32(groupRow.Cells["Batch"].Value).ToString("000") + " " + groupRow.Cells["Description"].Value.ToString(); } }