Cell value not refreshed

Hi,

we have a custom object bound to a ggc. I have attached a modified sample of the forum to show my problem.

There are two columns, the first is of type enum and the second one is a custom object. When you change a value of the first column (the enum column), the value of the second column (same row) is changed programmatically in the setter of the first column. But the new value isn't displayed in the second column. When you click in second row and then back in the first row the value is displayed.

It seems it is because of the IEditableObject interface in our model. But we need this interface.

Any idea what happens here?

Cheers,
Chris

RefreshCellValue.zip

1 Reply

HA haneefm Syncfusion Team June 12, 2007 06:56 PM UTC

Hi Chris,

One way you can resolve this problem by handling the TableControlCurrentCellChanged event and call the Table.EndEdit method to commit the changes to underlying data with grid. Here is a code snippet that show this task.

this.gridGroupingControl1.TableControlCurrentCellChanged += new GridTableControlEventHandler(gridGroupingControl1_TableControlCurrentCellChanged);

void gridGroupingControl1_TableControlCurrentCellChanged(object sender, GridTableControlEventArgs e)
{
if (e.TableControl.Table.CurrentElement.Kind == DisplayElementKind.Record)
{
GridTableCellStyleInfo style = e.TableControl.CurrentCell.Renderer.CurrentStyle as GridTableCellStyleInfo;
if (style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == "My Enum")
e.TableControl.Table.EndEdit();
}
}

Best regards,
Haneef

Loader.
Up arrow icon