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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Calculated properties not updated correctly

Thread ID:

Created:

Updated:

Platform:

Replies:

53640 Dec 18,2006 11:14 AM UTC Dec 18,2006 12:10 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 18, 2006 11:14 AM UTC

I have a BindingList, which is the datasource for a BindingSource. This BindingSource is the datasource for a grid.

The 'Person' class implements INotifyPropertyChanged, and includes a get/set 'Date' property. In the setter, PropertyChanged() is fired for another property, "IsEvenYear". The IsEvenYear property is a readonly bool, which returns whether 'Date' is an even-numbered year.

The problem is that the IsEvenYear column checkbox only updates to the correct value after moving to a new row. In other grids (including .Net DataGridView) the checkbox updates correctly as soon as another column on the same row is selected (e.g. by pressing Tab).

Can you please advise how to avoid this problem?

Administrator [Syncfusion]
Replied On December 18, 2006 11:17 AM UTC

I forget to mention - the grid class we are using is GridDataBoundGrid. We will also need to be able to do this in a GridGroupingControl.

Administrator [Syncfusion]
Replied On December 18, 2006 12:10 PM UTC

Hi Jeremy,

For DataBoundGrid :

To push all data to underlying datasource for every cell movement, you need to call in Binder.EndEdit Method(before calling this , you need to call the CurrentCell''s Edit method) in the CurrentCellMoving event of the grid. Here is a code snippet.

//CurrentCellMoving event.
this.grid.CurrentCell.EndEdit(); //saves the currentcell
this.grid.Binder.EndEdit(); //removes the pencil

For GridGroupingGrid:

You can handle the TableControlCurrentCellMoving event and call the Table.EndEdit() method. Here is a code snippet.

e.TableControl.CurrentCell.EndEdit(); //saves the currentcell
e.TableControl.Table.EndEdit();

Let me know if this helps.
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.

Warning Icon 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.Close Icon

;