Hi,
I have a dataset object that is binded to a datagrid in my main
thread. Now, when I add a row to the dataset object in a another
thread (since it may take awhile to complete), sometimes my
application will crash. I suspect this is because the ListChanged
event is raised on a different thread to the thread that my dataset
object was bound to the datagrid. My question is, how do I get around
this problem? I would think this would be a common problem, but
haven't found any answers.
Thanks in advance. 1 1287
"Kulgan" <ku*****@yahoo. com.au> wrote in message
news:3c******** *************** ***@posting.goo gle.com... Hi,
I have a dataset object that is binded to a datagrid in my main thread. Now, when I add a row to the dataset object in a another thread (since it may take awhile to complete), sometimes my application will crash. I suspect this is because the ListChanged event is raised on a different thread to the thread that my dataset object was bound to the datagrid. My question is, how do I get around this problem? I would think this would be a common problem, but haven't found any answers.
The answer is to add the row on the proper thread. Use dataGrid.Invoke .
John Saunders This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Iain |
last post by:
I've got a (VC++ 6.0) com object which does something asynchronously (writes
a DVD image, actually).
It rasies COM events to indicate progress, including completion.
I've got this running in a c# application, with the events coming up and
being caught (The idea is to use this to Set a ManualResetEvent which will
alow the rest of the processign to happen).
However, when I put an event after the call to start the async process off,
|
by: Andreas |
last post by:
Hi,
we have some problems with the following situation:
A remote application A writes files to a directory monitored by a
FileSystemWatcher-instance in application B. A creates the file
with the initial ending "COPY_IN_PROGRESS" and only after
successful copying the file gets renamed to its final ending
"TO_DO". The FileSystemWatcher of B is set to react on the
rename-event and upon recognizing an event some processing
is triggered.
|
by: Tom |
last post by:
Dear experts,
this time my problem is, that I will have objects of 3 different
classes, which all should receive their events without knowing each
other.
In real life the following happens:
I have three fingerprints which are waiting for a finger to be put on
sensor.
|
by: Bob Day |
last post by:
Using VS 2003, VB, MSDE...
There are two threads, A & B, that continously run and are started by Sub
Main. They instantiationsl of identical code. Thread A handles call
activity on telephone line 1 and Thread B handles call activity on telephone
line 2. They use a common SQL datasource, but all DataSets are unique to
each thread.
Is there a way for thread A to occasionally communication to thread B that
something has happened? ...
|
by: Charles Law |
last post by:
Suppose a worker thread needs to signal to the main thread that an event has
occurred. Ordinarily, any event raised by the worker thread will be on its
own thread.
How can the worker thread raise an event on the main thread instead?
TIA
Charles
| |
by: Kulgan |
last post by:
Hi,
I have a dataset object that is binded to a datagrid in my main
thread. Now, when I add a row to the dataset object in a another
thread (since it may take awhile to complete), sometimes my
application will crash. I suspect this is because the ListChanged
event is raised on a different thread to the thread that my dataset
object was bound to the datagrid. My question is, how do I get around
this problem? I would think this would be a...
|
by: Marcelo Cabrera |
last post by:
Hi,
I have a user control that in turn creates a bunch of webcontrols
dynamically and handles the events these webcontrols raise. It used to work
fine on ASP .Net 1.1 but when compiled on 2.0 it does not. The problem is
that the webcontrols get created on the OnLoad event of the usercontrol and
the event handlers are assigned at the same time. I have to click twice on
the controls for the events to be raised, the first time nothing...
|
by: Daniela Roman |
last post by:
Hello,
I try to fire an event under a button click event and maybe anybody can give
a clue please.
I have let's say a WEB grid with PageIndexChanged event:
private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
|
by: Amit Dedhia |
last post by:
Hi
I am developing an application using C++/CLI in Visual Studio 2005. In
my application I have following structure.
(1) Class A creates instances of Class B and Class C.
(2) Class B implements a timer function which repeatedly executes a
timer every 250 ms.
(3) Class C instance hooks for a event raised by Class B instance.
Class B always raises this event asynchronously at the end of timer
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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...
| |