Search This Blog

Tuesday, October 11, 2011

Silverlight System.Windows.Controls.ComboBox System.InvalidOperationException: Element is already the child of another element

Never try to use elements of Items collection of ComboBox directly and add them to a GRID like this:

SomeCellContainer.Add(SomeComboItems[iter]);

Everything works fine until you need to change the selected Item. When you press on the ComboBox (Silverlight behaviour) the application crashes with System.InvalidOperationException: Element is already the child of another element.

No comments:

Post a Comment

If you like this post, please leave a comment :)