Hi,
My GGC updates correctly from an external feed until I edit one of the cells. When I edit a cell it feeds back to servers, which then return with new values that are bound to the DataTable. After editing, the rows only update on the screen if I go to that row using arrow keys. They then refresh and show correct values.
(The underlying DataTable does update correctly. Also, if I do dt.AcceptChanges() the screen updates, but this causes massive performance issues, so I want to avoid doing this.)
I''ve tried calling cc.EndEdit(), cc.ConfirmChanges() but these don''t do the trick. I haven''t set any of the options in GGC.TableOptions.
Any ideas why the query cell style info stops refreshing after editing a cell?
Here is code for TableControlCurrentCellEditingComplete handler:
GridGroupingControl dataGrid = sender as GridGroupingControl;
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTextBoxCellRenderer gcrb = cc.Renderer as GridTextBoxCellRenderer;
GridTableCellStyleInfoIdentity style = dataGrid.TableModel[cc.RowIndex,cc.ColIndex].TableCellIdentity;
if(style.TableCellType == GridTableCellType.RecordFieldCell || style.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
string mappingName = style.Column.Name;
if(!(mappingName == "Arg1" || mappingName == "Arg2" || mappingName == "Arg3" ))
{
return;
}
double updatedText = double.Parse((string)style.DisplayElement.ParentRecord.GetValue(mappingName));
string staticTenor = (string)style.DisplayElement.ParentRecord.GetValue("StaticTenor");
IDictionaryEnumerator ienum = RecordCollection.GetEnumerator();
ienum.Reset();
while (ienum.MoveNext())
{
CustomRecord cr = ienum.Entry.Value as CustomRecord;
if (cr.CompleteName.IndexOf("."+staticTenor) > -1)
{
TransactionParam tp = new TransactionParam();
tp.FieldName = mappingName;
//Map the selectedItem onto corresponding int value
tp.ParamValue = updatedText;
TransactionParam[] params_ = {tp};
// Should put in exception checking
transact(params_, cr);
break;
}
}
}
// Last thing to do is reject changes so goes to old value, and is ready to get update from processUpdate
cc.RejectChanges();
cc.ResetCurrentCellWithoutDeactivate();
}