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++; }
I found that the fields I was trying to programmatically update had a BindingPath specified on them. AFter removing that, I was able to update the cell values as expected.
Hi Dustin (or anyone else)
In what event were you able to use e.Record?
I get this error on e.Record in XamDataGrid1_RecordDeactivating -
'Record' is not a member of 'System.Windows.RoutedEventArgs'.
Thank you.
Howard
For e, are you using ByVal e As System.Windows.RoutedEventArgs or something else?
Thank you!
This seeems to be what I needed -
ByVal e As Infragistics.Windows.DataPresenter.Events.RecordDeactivatingEventArgs)