I am using View as a Data Source to my DataGridView and I want the DataGridView to update automatically every X time with an updated View, and Its a problem because I am using View instead of SQL command.
As I’ve searched so far, I need to refresh the data source in the gridview to show updated data and it should be like that:
GridView.DataSource = null;
GridView.DataSource = ViewDataSource;
This does refresh the GridView, but with the same data.
the problem is that the view itself doesn’t change, even thought I wrote:
ViewDataSource.EndEdit();
I am pretty sure its because I havn’t start editing it and as I know the view was taken as the program started, so I am looking for a way to refresh my view (its my datagridview’s data source) with the updated data so I can add it to the grid.
Thanks!
GridView.Refresh() and add Application.DoEvents() for it to refresh immediately.