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

ComboBox errors when invisible

2 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tejash
Top achievements
Rank 1
Tejash asked on 13 Aug 2008, 01:41 PM
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 Answers, 1 is accepted

Sort by
0
Tejash
Top achievements
Rank 1
answered on 13 Aug 2008, 02:23 PM
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)    
0
Valeri Hristov
Telerik team
answered on 14 Aug 2008, 08:51 AM
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.
Tags
ComboBox
Asked by
Tejash
Top achievements
Rank 1
Answers by
Tejash
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or