微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Silverlight ComboBox Bug - Value does not fall within the expected range

Silverlight 2 ComboBox一个bug,今天被我遇到了,下面是IE错误信息:

 

Error: 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.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 System.Windows.Controls.Primitives.Selector.IsOnCurrentPage(Int32 index,Rect& itemsHostRect,Rect& listBoxItemRect)
   at System.Windows.Controls.Primitives.Selector.ScrollIntoView(Int32 index)
   at System.Windows.Controls.Primitives.Selector.SetFocusedItem(Int32 index,Boolean scrollIntoView)
   at System.Windows.Controls.ComboBox.PrepareContainerForItemOverride(DependencyObject element,Object item)
   at System.Windows.Controls.ItemsControl.UpdateContainerForItem(Int32 index)
   at System.Windows.Controls.ItemsControl.RecreateVisualChildren()
   at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedobj)   

 

有人找到了一个应对办法:http://compiledexperience.com/Blog/post/Gotcha-when-databinding-a-ComboBox-in-Silverlight.aspx

 

试过后可以解决我的问题

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐