472,992 Members | 3,808 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

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 5472
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

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

Similar topics

0
by: thomasp | last post by:
This is a two part question, 1) The code below should display a form with a datagridview and a few command buttons. This form should allow the user to make change to the records displayed in...
4
by: shibeta | last post by:
Hello, I have problem with DataGridView and BindingSource. I have created DataSet and added TableData to it with manualy created columns (without DataAdapter - I'm not using MSSQL). On the Form I...
2
by: wongray | last post by:
Hello Again. I have another question. I have a database where I have a combo list and If I want to add a new record in the combo list, and the data will not refresh until I go to the toolbar ...
1
by: MFayaz | last post by:
Hello! I have to refresh datagridview when database update , IS there any way to solution that my datagridview auto refresh when any user update database. Thanks in Advance
2
by: Ryan Liu | last post by:
Hi, In the same application, some other form inserted some data to the database. To refresh the DataGridView on the form shows those data, I just simple use Adapter fill the grid again. ...
1
by: siri11 | last post by:
Hi all.. How to refresh a datagridview control in c#.net so that,the grid becomes empty with empty rows and columns.And if incase any background color is applied to any of the grid row or column...
4
by: Christian | last post by:
Hi, i TRY to create a windows apllication that insert in a Access DB name and surname; the Insert istruction Works but the the refresh of DataGridView doesn't works... the code is : public...
2
by: senm | last post by:
hi, I am working in Windows Application using C# .net2005 In my application when I close the child window then the DataGridView in the parent window need to be automatically refreshed, and display...
2
OuTCasT
by: OuTCasT | last post by:
got some datagridviews on my page....after i have deleted a customer for example and it goes back to the page with the gridview....how i cld i refresh the gridview ??? At the moment i have a...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.