By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,371 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

refresh datagridview automatically

P: 17
Hi,

I have a Window Form to which i added a datagridview. The binding source is working well, but does not update if the database is modified outside the application (i mean not showing the modification made to the database).

Trying to solve my problem, i added a timer to the form that Fill the datagridview every xx milliseconds (basically a timer that calls the Form_Load method). The timer is working nicely, but because it always refresh the grid i can not "work" with the grid, can not add or delete any row because the refresh is too fast. If i change the timer delay for longer delay, i do not see the "real time" changes made outside the program.

What i would like to do is Fill (or anything else) the datagridview only when the data in the database is changed, so i could work in the datagridview of my form and also refresh it when changes have been made from outside the program.

I'm using VS 2005 Framework 2.0 and my program is C#.

Thanks in advance for your help
Apr 28 '08 #1
Share this Question
Share on Google+
2 Replies


kenobewan
Expert 2.5K+
P: 4,871
Maybe have your timer check for changes first and then if there are changes refresh. Alternately stop the timer while in edit mode and then start again after editing. HTH.
Hi,

I have a Window Form to which i added a datagridview. The binding source is working well, but does not update if the database is modified outside the application (i mean not showing the modification made to the database).

Trying to solve my problem, i added a timer to the form that Fill the datagridview every xx milliseconds (basically a timer that calls the Form_Load method). The timer is working nicely, but because it always refresh the grid i can not "work" with the grid, can not add or delete any row because the refresh is too fast. If i change the timer delay for longer delay, i do not see the "real time" changes made outside the program.

What i would like to do is Fill (or anything else) the datagridview only when the data in the database is changed, so i could work in the datagridview of my form and also refresh it when changes have been made from outside the program.

I'm using VS 2005 Framework 2.0 and my program is C#.

Thanks in advance for your help
Apr 28 '08 #2

P: 17
do you have any exemple of code you could provide me or link me to please... it looks like I actually am the main bug (hehe)

thanks
Apr 28 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.