views:

24

answers:

2

Hi All, I'm new with DataGrid View control, and I've this problem:

I would like to build a C# application with this control, bounded to a custom collection. If I change the data in the collection, I would expect that the grid should change in accordance. No problem in implementing this.

The question is, this control comes with the possibility to catch the changes and trigger a procedure, with the grid-cell that has been changed?

Many thanks, and sorry for my poor english.

Regards stefano

A: 

It sounds like you want to know when a particular cell has been edited. This event should do just that:

CellEndEdit - Occurs when edit mode stops for the currently selected cell. http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellendedit.aspx

Chris Breish
Thank, but doesn't works. This Event is triggered when I edit a cell. I would an event that fires when the collection bounded to my control is changed at runtime...
stexcec
What type of collection is it?
Chris Breish
A: 

Or you can catch DataGridView's CellValueChanged event.

David
same as before. There a way to implement the CollectionChanged event??
stexcec
I think you mean the PropertyChanged the event? Basically, your collection needs to implement INotifyPropertyChanged. Then when properies of your collection changed, you need to fire OnPropertyChanged event.http://msdn.microsoft.com/en-us/library/ms743695.aspx
David