简体   繁体   中英

WinForms C# DataGridView force refresh

Baby steps rolling... I have a form with a data grid bound to a table. I have some textboxes on the form bound to the table[columns], so as I scroll the grid, the textboxes show corresponding data.

I go to an "Edit Mode" of the textboxes and change the content and hit a save button. The grid doesn't refresh the changed context until I physically click in the cell which forces a call to the tables OnChanging and OnChanged events...

How can I FORCE whatever event to "flush" the table at the end of my edit and have it refreshed in the datagridview.

Thanks

您是否尝试过调用dataGridView的Invalidate方法?

this.dataGridView1.Invalidate();

Are you using a BindingSource? If so, call its EndEdit method on the TextBox's Leave event.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM