Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Refresh gridview after some delay

Posted on 2009-05-14
3
Medium Priority
?
344 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

972 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