Solved

Refresh gridview after some delay

Posted on 2009-05-14
3
338 Views
Last Modified: 2013-11-07
hello experts,

I have a web form and after filling details on the form and if I hit submit, I am calling a function called refreshGridView()

This function will set a datasource and do databind.

As on form submit I am inserting into couple of other databases, I want to call the refreshGridView after some delay.

a delay of 30 seconds and then refresh the grid. I tried various options like looking through just to cause some delay about it is binding the grid before the backend job is done. Please help
RefreshDelay=10000
 'If RefreshDelay > 0 Then
            '    For kt = 1 To RefreshDelay
            '        str = kt.ToString()
            '    Next
            'End If

Open in new window

0
Comment
Question by:rowmark
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 24390619
Try using Threading.Thread.Sleep(30000) and see if it gives you the needed delay.
0
 

Author Comment

by:rowmark
ID: 24390788
Thanks. It worked. Will it mess up any other things performance etc.
0
 
LVL 11

Accepted Solution

by:
Muhammad Ousama Ghazali earned 500 total points
ID: 24390894
For performance factor I cannot say much but I think it is pretty much standard to use the Thread.Sleep construct to delay the execution of the current task/thread within a process. Further, as per my understanding, it will not affect or mess other things even other requests to the same page by other users, so if it worked for you try it for some time but keep monitoring the performance. One thing you might have to handle if you are on WinForms is the ability to manage User Interface appropriately.
Further, try avoiding this delay in your applications especially the web applications as it will annoy the applicaiton users to wait for such long times. If the update of other databases/tables does not affect the refreshed gridview, try putting the code for updating in a separate thread and immediately return the control back to the user after refreshing the gridview.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question