473,378 Members | 1,531 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,378 software developers and data experts.

DataGridview update

Hi folks,

I have a datagridview with custom update-method where I access the
this.Rows property directly. I have no bindingsources, datatsets or
anything (and it would cost me a lot of work to change this).

Now I would like to update the datagridview by a background-thread.
How can I do that. The BeginInvoke-way seems not to work, as the
control is not updated.

Best regards,

Alex
Jun 27 '08 #1
1 2107
The BeginInvoke-way seems not to work, as the
control is not updated.
If you mean Control.BeginInvoke (not Delegate.BeginInvoke), then it
should work fine do... have you got any short code that demonstrates
this?

One issue is that it just might not update *yet* unless you use
Invoke; this of course means that you have to be very careful about
where you store the data you want to push into the grid (i.e. the
following pseudo# is bad)

string newValue;
for each row
{
newValue = someCalc();
this.BeginInvoke((MethodInvoker) delegate { theCell.Value =
newValue;});
}

The problem (above) is that there is no guarantee which version of
newValue went into each cell. It is less troublesome (and arguably
more performant) to call Invoke. but passing multiple values (rows/
etc) than lots of calls to Invoke/BeginInvoke.

Marc
Jun 27 '08 #2

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

Similar topics

10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
0
by: TNSFED | last post by:
I have a dilemma when trying to delete a row from the DataGridView. Here is a sample of my code: private void dgv_EQUPS_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) {...
2
by: bob | last post by:
Can anyone tell me the best way to update a dataset while it is being edited/viewed in the DataGridView control? Is this something that should be inserted into one of the grid's events? or should...
0
by: schoultzy | last post by:
Hello Everyone, I have been trying to figure this one out for two days now. I have created a DataGridView which is populated by an ObjectDataSource. My problem occurs when I attempt to use the...
4
by: Hexman | last post by:
Hello All, I'd like to find out the best way to add a cb column to a dgv and process efficiently. I see at least two ways of doing it. ------------------------------- 1) Add a cb to the dgv,...
4
by: Terry Olsen | last post by:
How can i tell if a row in my DataGridView has been edited? I'm loading a DataTable with ID3 information from MP3 files and using that as the datasource for the DataGridView. I'm letting the user...
3
by: =?Utf-8?B?THVib21pcg==?= | last post by:
Hi, I have a DataGridView that displays data from one table from database. I didn’t implement any my code, I just used wizard to do all the work with DatagridView populating. Visual Studio...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
7
by: Bill Schanks | last post by:
VB.NET 2005 SQL Server 2000 I have a datagridview that users will update. When there are only a few records the update is fine. However when they update 100-200 of the rows the udpate can take...
0
by: bharathi228 | last post by:
Hi, iam working with windows application.here my requirement is binding data to database from a datagridview. next i want to update some rows in datagridview and update it to the database.for...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.