473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.Threading.Timer instead? Thanks.
Jun 27 '08 #1
3 3234
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.Threading.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.Threading.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
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...
3
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
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...
5
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...
2
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...
1
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
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...
8
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...
5
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.