We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Cell value not refreshed

Thread ID:

Created:

Updated:

Platform:

Replies:

62284 Jun 12,2007 09:32 AM Jun 12,2007 02:56 PM Windows Forms 1
loading
Tags: GridControl
test
Asked On June 12, 2007 09:32 AM

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

haneefm [Syncfusion]
Replied On June 12, 2007 02:56 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;