Hi, i'm using the latest Telerik release.
Only on some machines I got this error:
An exception was uncaught System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at Telerik.WinControls.UI.RadTreeViewElement.SynchronizeNodeElements()
at Telerik.WinControls.UI.RadTreeViewElement.Update(UpdateActions updateAction)
at Telerik.WinControls.UI.RadTreeView.OnGotFocus(EventArgs e)
at System.Windows.Forms.Control.WmSetFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadTreeView.WndProc(Message& m)
Here's my Code, where am I doing something wrong?
//user control Load event
this.Load += new System.EventHandler(this.TreeView_Load);
private
void
TreeView_Load(
object
sender, EventArgs e)
{
radTreeView1.BeginEdit();
PatientEpicrisis epicrisis = MyAdapter.ReadPatientEpicrisis();
var currentNode =
this
.radTreeView1.Nodes[
"EpicrisiNode"
];
currentNode.Nodes.Clear();
if
(!
string
.IsNullOrEmpty(epicrisis.Note))
{
currentNode.Nodes.Add(epicrisis.EpicrisisSynthesis);
var lastNode = currentNode.LastNode;
lastNode.Tag = epicrisis;
lastNode.EndEdit();
}
else
{
currentNode.ContextMenu = radContextMenuEpicrisis;
}
currentNode.EndEdit();
radTreeView1.EndEdit();
}