WinForms C # DataGridView Force Updates

Baby steps are rolling ... I have a form with a data grid attached to a table. I have text fields in a form bound to a table [columns], as I scroll through the grid, the text fields show the corresponding data.

I go to the "Editing Mode" of the text fields and change the content and click the "Save" button. The grid does not update the changed context until I physically click on the cell that causes the OnChanging and OnChanged event tables to be called ...

How can I force any event to β€œclear” the table at the end of my editing and update it in the datagridview.

thanks

+6
c # refresh winforms datagridview
source share
2 answers

Have you tried calling the DataGridView Invalidate method?

this.dataGridView1.Invalidate(); 
+10
source share

Are you using a BindingSource? If so, call the EndEdit method in the Leave TextBox event.

+1
source share

All Articles