Re: Refreshing a DataGridView with live data
Posted by: Clay Goss
Date: August 15, 2013 06:09AM

I believe I have found the answer to my question. In the Form_Load event, I call a private method I named ReloadGrid(). It "new"s the MySQLCommand, MySQLDataAdapter, MySQLCommandBuilder and DataSet and uses the default SQL statement for the form to query out the data and load the grid. When the user completes entry on a row, changes the filter selections or just wants to refresh the data by clicking a button on the form, the code alters the SQL statement and calles ReloadGrid().

Perhaps, one would not need to "new" all of these objects, but it happens so quick, I decided to let it be for now and will experiment when I am not pressed by a deadline.

The wonderful thing is that I do not loose any load time formatting of the grid like column header text, column width, column visibility, etc. As I get a bit more accomplished with C#.NET I will implement a feature that saves a users changes and makes them so the next time they open the form, but for now...

Options: ReplyQuote


Subject
Written By
Posted
Re: Refreshing a DataGridView with live data
August 15, 2013 06:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.