468,743 Members | 2,157 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,743 developers. It's quick & easy.

refresh datagridview automatically

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
2 5090
kenobewan
4,871 Expert 4TB
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
YouPoP
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.

Similar topics

reply views Thread by thomasp | last post: by
2 posts views Thread by Ryan Liu | last post: by
4 posts views Thread by Christian | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.