Thanks for contacting us.
The reason for the exception you are getting is that you have already added an item in the Items
collection of your ListBox
by inserting the TextBlock
instance between the ListBox
tags in your XAML code. This is the one way to populate a ListBox
instance with items. The other way is to use the ItemsSource
property and assign an IEnumerable
instance to it. You cannot use both properties simultaneously to populate the control with items.
So, in your case you first add the TextBlock
instance from the XAML code and after that bind the ItemsSource
property to a collection of items which causes an exception because you already have an item added via XAML.
To solve this problem you should either remove the TextBlock
from the ListBox
in your XAML code, or simply use the ItemsSource
property to populate the control with items.
I hope this helps.
Do not hesitate to get back to us in case you have further questions or need assistance.
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>