C
C#15mo ago
pogonophobia

❔ My datagrid view is not refreshing instantly (WinForms)

After doing the button update function and populating the database, the data grid view is supposed to refresh but it doesn't. I've tried .refresh() and .invalidate() and .update() but those don't work either. Even if I add a manual refresh button, pressing on that won't show the newest database information. Only by going to another form then returning to this form does the new data show. I tried setting the datasource of the grid to null, that didn't work either. I also made it so that the entire form is destroyed and remade after insertion, it updates but it remains 1 update behind each time. So like If I update with 1 it wont show immediately, but if I update with 2 1 will show and 2 will show when I do the next update. Very weird indeed. I have another form with pretty much the same code and it works properly. Code is attached I think.
1 Reply
Accord
Accord15mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.