Solved

Refresh gridview after some delay

Posted on 2009-05-14
3
334 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now