473,779 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show progress timer while databinding

I have an app that shows the time it takes to execute a search, much like SQL Management Studio, but the app behaves as though the System.Windows. Forms.Timer gets blocked while binding the results to the grid. As you might expect, I execute the search in the background but I have to return to the UI thread to bind the results. While databinding, it appears as though the Timer.Tick event never gets fired, so my timer freezes at the time before the databinding, which could be the longest running part of the search.

Is my supposition that the databinding blocks the Timer correct? Is this where I should use System.Threadin g.Timer instead? Thanks.
Jun 27 '08 #1
3 3269
On Apr 29, 1:45*pm, David Smith wrote:
I have an app that shows the time it takes to execute a search, much like SQL Management Studio, but the app behaves as though the System.Windows. Forms.Timer gets blocked while binding the results to the grid. As you might expect, I execute the search in the background but I have to return to the UI thread to bind the results. While databinding, it appears as though the Timer..Tick event never gets fired, so my timer freezes at the time before the databinding, which could be the longest running part of the search.

Is my supposition that the databinding blocks the Timer correct? Is this where I should use System.Threadin g.Timer instead? Thanks.
Hi,

I do not think you can do that, the DataBinding should be done in the
UI thread, so the UI will be frozen during it.

There is no sense to use any other timer as the UI thread is blocked
and it will not process any other mesage until it ends.

Why is your databinding taking so long though?
Jun 27 '08 #2
If your data-binding is taking that long, it suggests you have too
much data. Either reduce the data-volume, or switch to "virtual mode":

http://msdn2.microsoft.com/en-us/library/ms171622.aspx

Marc
Jun 27 '08 #3
David Smith wrote:
I have an app that shows the time it takes to execute a search, much
like SQL Management Studio, but the app behaves as though the
System.Windows. Forms.Timer gets blocked while binding the results to
the grid. As you might expect, I execute the search in the background
but I have to return to the UI thread to bind the results. While
databinding, it appears as though the Timer.Tick event never gets
fired, so my timer freezes at the time before the databinding, which
could be the longest running part of the search.

Is my supposition that the databinding blocks the Timer correct? Is
this where I should use System.Threadin g.Timer instead? Thanks.
You could start a new UI thread and show your progress bar there.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
537
by: Chris Thunell | last post by:
Right now I have a vb.net windows form project that does a whole bunch of things on the form.load event. The problem with this is that the user does not see the form until all the those things are done. Is there a way for a form to be shown first AND THEN have it automatically start to run through my code? (perhaps a different event??? form.paint, form.activate) Right now... the form is running but the user can't see it, and so they...
3
2043
by: Jeff S | last post by:
I'm enabling users to upload files to the server. I'd like to show them some indication of percent complete. How can this be done? Thanks!
7
2538
by: Steve Kallal | last post by:
I have seen this subject tossed around in this forum before. But in my case I need a simple solution. I do NOT need to show progress in terms on percentage complete. But rather I need to show a visual indicator to the user that a process is running. There are two scenarios where I need to show a busy indicator: Scenario #: The first is when posting to the web server and waiting for a response.
5
3245
by: B-Dog | last post by:
I'm trying to build a custom progress bar that will run as some subs are running in the background but when I open the custom form with the progress bar on it using the showdialog, none of the subs run until the form is closed but I need the form to be on top so the users can't click anywhere else till the tasks are complete. How would I go about doing this? I need to open this form, runs some subs, then close the form. Thanks
2
2956
by: Robert Smith | last post by:
Hello, I have a problem with my progress bar, as shown in the attached code, the values on the bar are incremented within a threaded timer event. The timer works fine and ticks all the way through. However when you Add a new status bar to the form with a Progress bar and then immediately perform some intense programming that uses a lot of processor resources, the bars in the progress bar are not displayed, even though the timer appears to...
1
1308
by: Nikolay Petrov | last post by:
I would like to display in progress bar the remaining time, until Timer.Elapsed event is fired. Any ideas? I am using System.Timer.Timer thanks
2
444
by: Diogo Alves - Software Developer | last post by:
Hi, I am having a giant headache because a progress bar on a statusStrip. Ok I will describe all the details to get help from anyone.... I have a MainForm, this form as a a component that is a menuPanel in the left and content a panel in the right, in the panel I am loading forms... when I select a item from the menuPanel I dispose the form in the right and
8
4756
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large binary files, so have created a second thread to do the processing. This thread is set to be the LOWEST priority. So far so good with all that. HOWEVER, I am trying to provide some feedback to the user (the bane of our existence!) via a progress...
5
6936
by: CCLeasing | last post by:
For an application I'm creating I want to create a 'fake' progress bar. By fake I mean a progress bar that looks like it's doing something but actually isn't. I know philosophically this isn't sound. But my little app is a 'fake' app and is designed to look like another - hence this seeming crazy situation of needing to fake a progess bar. PROBLEM.
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.