How to refresh the DataSource on a WinForms DataGridView?
问题 I populate the GridView.DataSource from a EntityFramework Model: gwTimeLog.DataSource = _entities.TimeLogs; When a new row is added to the _entities, I try to update the grid (tried using the same statement as above, setting it null, then back to _entities.TimeLogs, etc...), but the grid simply won't update. Even though _entities.TimeLogs actually does contain the new rows. What am I missing? 回答1: OLD ANSWER: Did you try calling GridView.DataBind()? Woops, I thought this was a WebForms