Re: Refreshing a DataGridView with live data
Posted by: Clay Goss
Date: August 16, 2013 07:07AM

I have it all working now for my WinForm. The tricks are:

- Must "new" the the MySqlCommand, MySQLDataAdapter, MySqlCommandBuilder and DataSet objects, then run the data fetch as in the form load.

- Cannot call this while a row is in "edit" mode.

- If the user is on row 68 and cell 16, the grid will be on row 0 cell 0, or at the least, on cell 0 of the current row when the refresh completes

- No load time formatting is lost. User changes, such as column re-sizing or relocating are also not lost.

I wanted the grid to refresh after an edit, so I put a timer on the form and enabled it at the end of the RowValidated event. The timer then calls the ReloadGrid method after saving the current row and cell to a point and sets the focus back after.

Options: ReplyQuote


Subject
Written By
Posted
Re: Refreshing a DataGridView with live data
August 16, 2013 07:07AM


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.