EDN Admin
Well-known member
<p align=left><font face=Arial size=2>Hi...</font>
<p align=left>
<blockquote dir=ltr style="margin-right:0px
<p dir=ltr style="margin-right:0px" align=left> In my application i am using <u>ZedGraph</u> graph drawing tool. I added a <u>BackGroundWorker</u> thread in my application... I am continuosly drawing the graph in the BackGroundWorker thread... But while drawing the graph I am getting an unexpected error.
<p align=left>
<p align=left> I am handling all cross-threaded operations correctly.. Here are the details of the error...
<p align=left><span style="font-size:9.5pt;font-family:Verdana <span style="font-size:9.5pt;font-family:Verdana <span style="font-size:12pt;font-family:Times New Roman <font face=Arial size=2>
<p class=MsoNormal style="margin:0in 0in 0pt System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
<p class=MsoNormal style="margin:0in 0in 0pt <span style=" at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
<p class=MsoNormal style="margin:0in 0in 0pt <span style=" at System.Collections.Generic.List`1.Enumerator.MoveNext()
<p class=MsoNormal style="margin:0in 0in 0pt <span style="font-size:12pt;font-family:Times New Roman <font face=Arial><font size=2> <span style=" at </font></font> ...
<p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman
<p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman
<p class=MsoNormal dir=ltr style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman I used <u> lock </u> also for the graph control in the <u>OnPaint</u> event... The collection modified error is for the CurveList of the graph... I am filling the CurveList before calling the Refresh() for the ZedGraph control... <font face=Verdana size=2>I am drawing the graph from worker thread continously... </font></font>
<p align=left><span style="font-size:9.5pt;font-family:Verdana This error is not coming everytime...
<p align=left><span style="font-size:9.5pt;font-family:Verdana
<p align=left><span style="font-size:9.5pt;font-family:Verdana
<blockquote dir=ltr style="margin-right:0px
<p align=left><span style="font-size:9.5pt;font-family:Verdana Can anybody suggest me something...
<p align=left><span style="font-size:9.5pt;font-family:Verdana </blockquote></blockquote>
<p dir=ltr align=left><span style="font-size:9.5pt;font-family:Verdana Thanks in adavance,
<p dir=ltr align=left><span style="font-size:9.5pt;font-family:Verdana Vinay
View the full article
<p align=left>
<blockquote dir=ltr style="margin-right:0px
<p dir=ltr style="margin-right:0px" align=left> In my application i am using <u>ZedGraph</u> graph drawing tool. I added a <u>BackGroundWorker</u> thread in my application... I am continuosly drawing the graph in the BackGroundWorker thread... But while drawing the graph I am getting an unexpected error.
<p align=left>
<p align=left> I am handling all cross-threaded operations correctly.. Here are the details of the error...
<p align=left><span style="font-size:9.5pt;font-family:Verdana <span style="font-size:9.5pt;font-family:Verdana <span style="font-size:12pt;font-family:Times New Roman <font face=Arial size=2>
<p class=MsoNormal style="margin:0in 0in 0pt System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
<p class=MsoNormal style="margin:0in 0in 0pt <span style=" at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
<p class=MsoNormal style="margin:0in 0in 0pt <span style=" at System.Collections.Generic.List`1.Enumerator.MoveNext()
<p class=MsoNormal style="margin:0in 0in 0pt <span style="font-size:12pt;font-family:Times New Roman <font face=Arial><font size=2> <span style=" at </font></font> ...
<p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman
<p class=MsoNormal style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman
<p class=MsoNormal dir=ltr style="margin:0in 0in 0pt" align=left><span style="font-size:12pt;font-family:Times New Roman I used <u> lock </u> also for the graph control in the <u>OnPaint</u> event... The collection modified error is for the CurveList of the graph... I am filling the CurveList before calling the Refresh() for the ZedGraph control... <font face=Verdana size=2>I am drawing the graph from worker thread continously... </font></font>
<p align=left><span style="font-size:9.5pt;font-family:Verdana This error is not coming everytime...
<p align=left><span style="font-size:9.5pt;font-family:Verdana
<p align=left><span style="font-size:9.5pt;font-family:Verdana
<blockquote dir=ltr style="margin-right:0px
<p align=left><span style="font-size:9.5pt;font-family:Verdana Can anybody suggest me something...
<p align=left><span style="font-size:9.5pt;font-family:Verdana </blockquote></blockquote>
<p dir=ltr align=left><span style="font-size:9.5pt;font-family:Verdana Thanks in adavance,
<p dir=ltr align=left><span style="font-size:9.5pt;font-family:Verdana Vinay
View the full article