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

Exception thrown on ComboBox when item clicked

1 Answer 98 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gilberto
Top achievements
Rank 1
Gilberto asked on 27 Apr 2009, 11:59 PM
Ok i have ran into a bit of a problem i keep getting the an error any time i select an item from the combo box in silverlight 2.0'
I have not wired up any events to the combo box and am accessing data from a service. 

The class being returned from the service contains the value Name of type string that im having be displayed in the box.
Im unsure what i have done wrong in this situation. It is populating the box with the names,  but crashed out the minute i click to open the list of the items. Now if i use the mouse wheel to scroll through the items it doesnt crash.  Any ideas as to what is wrong would be appreciated.

Thanks

XAML for the control,   Control imbeded inside of a stackpanel
 
<telerikInput:RadComboBox x:Name="cbFilterWebSites" ItemsSource="{Binding}" DisplayMemberPath="Name"/>  

Code Behind
  void _proxy_GetWebsitesCompleted(object sender, GetWebsitesCompletedEventArgs e)  
        {  
             
                ObservableCollection<Website> result = e.Result;  
                  
                //create none value for filter  
                cbFilterWebSites.DataContext result;  
             
 
        } 
Error
{System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at Telerik.Windows.Controls.RadComboBox.IsOnCurrentPage(Object item, Rect& itemsHostRect, Rect& listBoxItemRect)
   at Telerik.Windows.Controls.RadComboBox.ScrollIntoView(Object item)
   at Telerik.Windows.Controls.RadComboBox.NavigateToItem(Object item)
   at Telerik.Windows.Controls.RadComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
   at Telerik.Windows.Controls.Selector.OnSelectionChanged(Object sender, SelectionChangedEventArgs e)
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.InvokeSelectionChangedEvent()
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.End()
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.SelectJustThisItem(T item)
   at Telerik.Windows.Controls.RadComboBox.NotifyComboBoxItemMouseUp(RadComboBoxItem comboBoxItem)
   at Telerik.Windows.Controls.RadComboBoxItem.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)}

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 28 Apr 2009, 06:58 AM
Hi Gilberto,

We were unable to reproduce this exception. Is there any chance that you place the combo inside Popup control (or the combo parent control)? There is known issue with TransformToVisual method not working when placed inside Popup (RadWindow is using popup too but we have fixed this). If you are not using popup control can you send us sample code demonstrating this issue (we were unable to reproduce it)?

Thanks.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
Gilberto
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or