DataGridView CellValueChanged event not firing

P

pat.maher

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.
 
J

Jim Wooley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top