I have a DataGridView bound to a BindingList (C# Windows Forms). If I change one of the values in an item in the list it does not immediately show up in the grid. If I click on the changed cell, or minimize then maximize the window it updates properly, but I need it to happen automatically.
I had the same problem earlier, but in that situation I had to change the cell's background colour at the same time that the value changed. This caused the cell to refresh correctly.
The only way I can get it to work is...
dataGridView.DataSource = null;
dataGridView.DataSource = myBindingList
...but I'd really like to avoid this as it makes the scrollbar pop back to the top, and means that I'd have to set my cell background colours again. Surely there's a better way. I've tried Refresh (as well as refreshing the parent), Update, and Invalidate, but they're not doing what I need.
I've seen this problem mentioned on a few message boards, but haven't seen a working answer to it yet.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…