Solved

Refresh gridview after some delay

Posted on 2009-05-14
3
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

626 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