ComboBox errors when invisible

3 posts, 0 answers
  1. Tejash
    Tejash avatar
    2 posts
    Member since:
    Aug 2008

    Posted 13 Aug 2008 Link to this post

    I have a silverlight combobox on my page within a grid...initially, the grid's visibility is set to collapsed. When the page loads, I bind the combobox to a list of strings and everything is fine. When I click a button to set the visibility of the grid to visible, the page errors out.

    Seems like the combobox isn't rendering correctly if it is initially invisible, or something along those lines. Any ideas?

    Tejash
  2. Tejash
    Tejash avatar
    2 posts
    Member since:
    Aug 2008

    Posted 13 Aug 2008 Link to this post

    It seems like it has something to do with the width of the combobox...if I explicitly set the width to a number, then it does not error. If I dont set the width and have HorozontalAlignment = Stretch) then I get a "Value out of range" exception:

    Unhandled Error in Silverlight 2 Application
    Code: 4004   
    Category: ManagedRuntimeError      
    Message: System.ArgumentException: Value does not fall within the expected range.
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, Double d)
       at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, Object obj)
       at System.Windows.DependencyObject.SetObjectValueToCore(IntPtr oPtr, DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
       at System.Windows.TemplateBindingExpression.SourcePropertyChanged(DependencyObject c, DependencyProperty dp)
       at System.Windows.DependencyPropertyChangedWeakListener.SourcePropertyChanged(DependencyObject c, DependencyProperty dp)
       at System.Windows.DependencyPropertyChangedEventHandler.Invoke(DependencyObject sender, DependencyProperty dp)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.RadComboBox.set_DropDownWidth(Double value)
       at Telerik.Windows.Controls.RadComboBox.RadComboBoxSizeChanged(Object sender, SizeChangedEventArgs e)
       at System.Windows.FrameworkElement.OnSizeChanged(Object sender, SizeChangedEventArgs e)
       at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)    
  3. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 Aug 2008 Link to this post

    Hello Tejash,

    Thank you for reporting that problem. I managed to reproduce and fix it. The fix will be included in the official update of RadControls for Silverlight, which will be released afted a couple of weeks. Until then, I recommend using the fix you have found. Your points have been updated.

    All the best,
    Valeri Hristov (Silverlight Team)
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top