Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
GeneralDB IV .DBF Databases Pin
gmhanna5-Oct-03 9:33
gmhanna5-Oct-03 9:33 
GeneralRe: DB IV .DBF Databases Pin
Randhir Sinha6-Oct-03 2:05
Randhir Sinha6-Oct-03 2:05 
GeneralRuntime Object state. Pin
Anonymous5-Oct-03 8:39
Anonymous5-Oct-03 8:39 
GeneralRe: Runtime Object state. Pin
Blake Coverett5-Oct-03 10:31
Blake Coverett5-Oct-03 10:31 
Questionprinter minimum margins?? Pin
mistery225-Oct-03 7:59
mistery225-Oct-03 7:59 
AnswerRe: printer minimum margins?? Pin
Nick Parker5-Oct-03 9:29
protectorNick Parker5-Oct-03 9:29 
GeneralRe: printer minimum margins?? Pin
mistery225-Oct-03 12:04
mistery225-Oct-03 12:04 
GeneralDataGrid and multiple threads Pin
ke5in5-Oct-03 5:32
ke5in5-Oct-03 5:32 
I’m using the MS DataGrid on a form. Each row displays the state of an
instance of a class. When I load this form it creates the collection of
these classes and spawns a maintenance thread that keeps these instances
updated with info scraped from a website. Each class instance has a
reference to the DataTable of the DataGrid and is able to update its own row
in the grid. This works fine. You can sit back and watch this grid
refreshing "in the background" while manipulating other elements of the form.

I ran into problems when I tried to have this thread delete a row from the
grid. Intuitively this makes sense since there is probably a race condition
between the form thread and the maintenance thread where the delete is taking
place. I got around this problem by having the actual grid row deleted on the form thread.
But I'm worried that there might be some hidden race
condition waiting to happen when I do my updates. Any comments would be
greatly appreciated. Smile | :)


Thanks,
Kevin

Here is the error I get when I delete from the Update thread.

=====
An unhandled exception of type 'System.IndexOutOfRangeException'
occurred in system.windows.forms.dll

Additional information: No value at index 2.
=====





Unhandled Exception: System.IndexOutOfRangeException: No value at index 2.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.DataGridRow.PaintHeader(Graphics g, Rectangle
visualBounds, Boolean alignToRight, Boolean rowIsDirty)
at System.Windows.Forms.DataGridRelationshipRow.PaintHeaderInside
(Graphics g, Rectangle bounds, Brush backBr, Boolean alignToRight, Boolean
isDirty)
at System.Windows.Forms.DataGridRelationshipRow.PaintHeader(Graphics g,
Rectangle bounds, Boolean alignToRight, Boolean isDirty)
at System.Windows.Forms.DataGrid.PaintRows(Graphics g, Rectangle&
boundingRect)
at System.Windows.Forms.DataGrid.PaintGrid(Graphics g, Rectangle
gridBounds)
at System.Windows.Forms.DataGrid.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods
+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Track9.frmMain.Main()

Questionwhich one is faster? Pin
abc8764-Oct-03 13:07
abc8764-Oct-03 13:07 
AnswerRe: which one is faster? Pin
J. Dunlap4-Oct-03 13:41
J. Dunlap4-Oct-03 13:41 
GeneralRe: which one is faster? Pin
leppie4-Oct-03 23:49
leppie4-Oct-03 23:49 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 9:46
J. Dunlap5-Oct-03 9:46 
GeneralRe: which one is faster? Pin
leppie5-Oct-03 13:36
leppie5-Oct-03 13:36 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 13:56
J. Dunlap5-Oct-03 13:56 
GeneralRe: which one is faster? Pin
David Stone5-Oct-03 14:28
sitebuilderDavid Stone5-Oct-03 14:28 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 14:32
J. Dunlap5-Oct-03 14:32 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 15:12
J. Dunlap5-Oct-03 15:12 
GeneralRe: which one is faster? Pin
zecodela5-Oct-03 18:06
zecodela5-Oct-03 18:06 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 18:18
J. Dunlap5-Oct-03 18:18 
AnswerRe: which one is faster? Pin
WillemM5-Oct-03 21:05
WillemM5-Oct-03 21:05 
GeneralOutlook time schedule table Pin
Aryo Handono4-Oct-03 10:24
professionalAryo Handono4-Oct-03 10:24 
Generalcontrol.Focus Pin
gmhanna4-Oct-03 8:23
gmhanna4-Oct-03 8:23 
GeneralRe: control.Focus Pin
J. Dunlap4-Oct-03 12:42
J. Dunlap4-Oct-03 12:42 
Generaldatabinding in a listview Pin
Anonymous4-Oct-03 4:26
Anonymous4-Oct-03 4:26 
GeneralInsert Image into MS-SQL Pin
Hovik Melkomian4-Oct-03 1:22
Hovik Melkomian4-Oct-03 1:22 

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.