Solved

Refresh gridview after some delay

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

15 Experts available now in Live!

Get 1:1 Help Now