This is a migrated thread and some comments may be shown as answers.

ComboBox set ItemSource and SelectedItem asyncronously

0 Answers 68 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Laszlo
Top achievements
Rank 1
Laszlo asked on 24 Jun 2011, 03:51 PM
Hi,

I have an issue when using RadCombobox. I use MVVM pattern so I have a viewmodel with an observable collection which is binded to the ItemSource Property to RadCombobox and a SelectedItem property which is binded to the SelectedItem Property to RadComboBox.

How can I syncronize that the ItemSource will be loaded first and after the RadComboBox sets the SelectedItem?

When I used the "simple" Combobox I found a solution about this problem:

http://ppe.code.msdn.microsoft.com/ComboBox-Sample-for-RIA-db6a089f/sourcecode?fileId=19458&pathId=1955785271

I tried to use this solution for RadComboBox and it is working but when I try to select a new combobox value manualy I get the following exception.

"throw new Error("Unhandled Error in Silverlight Application Object reference not set to an instance of an object.   Hely: Telerik.Windows.Controls.RadComboBoxItem.BringIntoView()\n   Hely: Telerik.Windows.Controls.RadComboBox.ScrollIntoView(Object item)\n   Hely: Telerik.Windows.Controls.RadComboBox.NavigateToItem(Object item)\n   Hely: Telerik.Windows.Controls.RadComboBox.OnSelectionChanged(SelectionChangedEventArgs e)\n   Hely: Telerik.Windows.Controls.RadComboBox.SelectItemDelayedSelectionChanged(Object item)\n   Hely: Telerik.Windows.Controls.RadComboBox.NotifyComboBoxItemMouseUp(RadComboBoxItem comboBoxItem)\n   Hely: Telerik.Windows.Controls.RadComboBoxItem.OnMouseLeftButtonUp(MouseButtonEventArgs e)\n   Hely: System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)\n   Hely: MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)");"

Do telerik have a solution for this syncronizing problems?

Best Regards Laszlo

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Laszlo
Top achievements
Rank 1
Share this question
or