Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: Show a hidden console again? Pin
V.16-Sep-11 0:36
professionalV.16-Sep-11 0:36 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 0:47
Don Rolando16-Sep-11 0:47 
AnswerRe: Show a hidden console again? Pin
Alan N16-Sep-11 3:04
Alan N16-Sep-11 3:04 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 3:19
Don Rolando16-Sep-11 3:19 
AnswerRe: Show a hidden console again? Pin
PIEBALDconsult16-Sep-11 3:19
mvePIEBALDconsult16-Sep-11 3:19 
GeneralRe: Show a hidden console again? Pin
Don Rolando16-Sep-11 3:22
Don Rolando16-Sep-11 3:22 
QuestionDataGridView throws Data Pin
beauroak15-Sep-11 15:15
beauroak15-Sep-11 15:15 
AnswerRe: DataGridView throws Data Pin
Luc Pattyn15-Sep-11 15:29
sitebuilderLuc Pattyn15-Sep-11 15:29 
Hi,

1. please don't apply PRE tags to text. PRE tags is for special formatting, it applies to code snippets, and tabular data, not regular text.

2. you shouldn't read and write data structures in general from more than one thread without proper locks. Adding/removing a row in a DT or a DGV may (and probably always will) render the internal state invalid for as long as the update takes, so another thread reading it would get confused, obtain wrong data, and maybe even hang. I see basically three ways to resolve your problem:

a) use real locks; as one of the interested parties is the main thread (which displays the DGV for you), this is a no-no, as you shouldn't keep the main thread waiting at all.

b) tell the other thread to have the updates delegated to the main thread; there are at least two ways to get that done:
b1) with Control.Invoke, see this little article[^];
b2) with BackgroundWorker.ReportProgress, which probably is most appropriate for your situation.

c) use two DataTables: one that gets displayed (by the main thread), and one that gets calculated (by the background thread); when the calculation finishes, have the main thread display the new DT rather than the old one. "ping-pong".

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
modified on Thursday, September 15, 2011 10:52 PM

Questionretrive gridview cell value Pin
jashimu15-Sep-11 9:55
jashimu15-Sep-11 9:55 
AnswerRe: retrive gridview cell value Pin
walterhevedeich15-Sep-11 15:56
professionalwalterhevedeich15-Sep-11 15:56 
Questionhow to write regular expression for this code? Pin
SRKSHOME15-Sep-11 6:48
SRKSHOME15-Sep-11 6:48 
AnswerRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 7:33
professionalBillWoodruff15-Sep-11 7:33 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 19:43
SRKSHOME15-Sep-11 19:43 
AnswerRe: how to write regular expression for this code? Pin
OriginalGriff15-Sep-11 8:26
mveOriginalGriff15-Sep-11 8:26 
GeneralRe: how to write regular expression for this code? Pin
PIEBALDconsult15-Sep-11 9:10
mvePIEBALDconsult15-Sep-11 9:10 
GeneralRe: how to write regular expression for this code? Pin
OriginalGriff15-Sep-11 9:15
mveOriginalGriff15-Sep-11 9:15 
GeneralRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 21:42
professionalBillWoodruff15-Sep-11 21:42 
GeneralRe: how to write regular expression for this code? Pin
BillWoodruff15-Sep-11 21:43
professionalBillWoodruff15-Sep-11 21:43 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 20:21
SRKSHOME15-Sep-11 20:21 
GeneralRe: how to write regular expression for this code? Pin
Pete O'Hanlon15-Sep-11 20:32
mvePete O'Hanlon15-Sep-11 20:32 
GeneralRe: how to write regular expression for this code? Pin
SRKSHOME15-Sep-11 21:03
SRKSHOME15-Sep-11 21:03 
AnswerRe: how to write regular expression for this code? Pin
Luc Pattyn15-Sep-11 10:41
sitebuilderLuc Pattyn15-Sep-11 10:41 
GeneralRe: how to write regular expression for this code? Pin
PIEBALDconsult15-Sep-11 14:44
mvePIEBALDconsult15-Sep-11 14:44 
AnswerRe: how to write regular expression for this code? Pin
Luc Pattyn15-Sep-11 14:47
sitebuilderLuc Pattyn15-Sep-11 14:47 
QuestionDifference Between _number and number Pin
eddieangel15-Sep-11 6:11
eddieangel15-Sep-11 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.