Editing DataGridView with binding and updating columns in C #

I have a DataGridView where the DataSource is a BindingList. Most of the columns are updated - via various timers that call PropertyChanged ("...") on the associated columns. One column - the problematic one - is the DataGridViewComboBoxColumn - where the user selects an item from a list of items.

The problem is the DataGridViewComboBoxColumn is not being used. It blinks constantly - apparently when PropertyChanged events happen - and whatever item I try to select it stays the same.

Any idea what I am doing wrong?

0


source to share


2 answers


First of all, add some sample code so we can better understand what you mean.

Secondly, what you are doing sounds strange. Why are you calling PropertyChanged () manually on a timer? Why don't you implement INotifyPropertyChanged in your class?



Or, you can use a wrapper that implements ICustomTypeDescriptor and INotifyPropertyChanged for your items. In this case, the wrapper will automatically add the INotifyPropertyChanged implementation for your classes. Find information online about why you need ICustomTypeDescriptor and how it can help.

0


source


One problem that can arise is that the DataGridViewComboBox control does not commit the change in value until the cell has been checked by a user navigating to another cell. You can make this behavior happen when the value changes by using the CurrentCellDirtyStateChanged event.



0


source







All Articles