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
45
How to programmatically edit a cell value directly?
posted

I have some fields where I need to actually input the data programmatically, on the fly in the OnGridInitializeRecord event handler.  I want to just edit the Cell.Value property, but for some reason the value is still NULL even after it is set with any value (such as any string value).

Is there something I'm missing?  The code I'm using to set the cell value is:

 

 

                DataRecord record = (DataRecord)e.Record;
                int count = 0;
                foreach (Cell cell in record.Cells)
                {
                    Field f = cell.Field;
                    string columnName = f.Label.ToString();
 
                    foreach (CustomColumn appCol in taskVM.Task.CustomColumns)
                    {
                        if (appCol.ColumnName == columnName)
                        {
                            EclpGrid taskListGrid = this.eclpViewPointContentLayout.Content as EclpGrid;
                            if (taskListGrid != null)
                            {
                                (taskListGrid.Records[e.Record.Index] as DataRecord).Cells[count].Value = appCol.ColumnValue;
                            }
                        }
                    }
 
                    count++;
                }