I have a DataGridView that is bound to a list of objects through it's
datasource property.
If a cell in the grid is changed by editing directly in the cell I get
a CellValueChanged event.
If the value is changed in the underlying object that causes the cell
in the grid to get changed then the CellValueChanged event does not
occur.

Does anyone know of a way to detect a cell value changing for both
cases? I would like to detect the value change without leaving the row
since I am trying to give immediate visual feedback regarding the
validity of the data being entered and don't want the user to have to
leave the row to find out if data in a cell is valid.

Re: DataGridView CellValueChanged event not firing by Jim

Jim
Fri Aug 11 09:32:41 CDT 2006

How are you firing the notification that your custom object's value changed?
In the past, you could have an event for each property addign the Changed
suffix (thus for MyProperty, you would have a MyPropertyChanged event that
you would fire as necessary). The DGV SHOULD listen for these events and
update accordingly. I have noticed it doesn't play nice occasionally.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx

> I have a DataGridView that is bound to a list of objects through it's
> datasource property.
> If a cell in the grid is changed by editing directly in the cell I get
> a CellValueChanged event.
> If the value is changed in the underlying object that causes the cell
> in the grid to get changed then the CellValueChanged event does not
> occur.
> Does anyone know of a way to detect a cell value changing for both
> cases? I would like to detect the value change without leaving the row
> since I am trying to give immediate visual feedback regarding the
> validity of the data being entered and don't want the user to have to
> leave the row to find out if data in a cell is valid.
>