gzgood 发表于 2016-7-19 13:46:04

C1FlexGrid错误“-17”不是属性“ViewportSize”的有效值

有些用户在对FlexGrid进行新增行操作,然后编辑,会出现以下bug,但不是每次都会出现。
看日志应该是控件报的异常,我想问一下是什么原因造成的,如何解决

全局异常:“-17”不是属性“ViewportSize”的有效值。
   在 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   在 System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   在 C1.WPF.FlexGrid.C1FlexGrid.UpdateScrollBars()
   在 C1.WPF.FlexGrid.C1FlexGrid._gCells_LayoutUpdated(Object sender, EventArgs e)
   在 System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   在 System.Windows.ContextLayoutManager.UpdateLayout()
   在 System.Windows.UIElement.UpdateLayout()
   在 System.Windows.Interop.HwndSource.SetLayoutSize()
   在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   在 System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   在 System.Windows.Controls.Primitives.Popup.SetRootVisualToPopupRoot()
   在 System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)
   在 System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   在 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   在 System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
   在 System.Windows.Controls.Primitives.Popup.CreateRootPopup(Popup popup, UIElement child)
   在 System.Windows.Controls.ToolTip.HookupParentPopup()
   在 System.Windows.Controls.ToolTip.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   在 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   在 System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   在 System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent()
   在 System.Windows.Controls.PopupControlService.InspectElementForToolTip(DependencyObject o)
   在 System.Windows.Controls.PopupControlService.OnMouseMove(IInputElement directlyOver, Point pt)
   在 System.Windows.Controls.PopupControlService.OnPostProcessInput(Object sender, ProcessInputEventArgs e)
   在 System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   在 System.Windows.Input.InputManager.ProcessStagingArea()
   在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   在 System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   在 System.Windows.Application.RunDispatcher(Object ignore)
   在 System.Windows.Application.RunInternal(Window window)
   在 System.Windows.Application.Run(Window window)
   在 EpointZaoJia_WPF.App.Main(String[] args)

KNight 发表于 2016-7-19 14:58:37

有Demo可以还原问题吗?

Alice 发表于 2016-7-19 17:37:33

谢谢您的反馈。
从异常信息来看,是在改变可视区域的Size的时候发生了异常。
仅从描述信息,我们无法重现该问题,我们需要能重现该问题Demo,然后才能帮您看看。

gzgood 发表于 2016-7-20 09:46:09

因为是用户机子上出现的问题,本机也没有重现,所以暂时也没有demo

Alice 发表于 2016-7-20 12:21:49

gzgood 发表于 2016-7-20 09:46
因为是用户机子上出现的问题,本机也没有重现,所以暂时也没有demo

之前有类似的异常,是因为设置了Border的Enable属性。
请参考帖子,检查是否有类似的设置:http://gcdn.gcpowertools.com.cn/showtopic-19695-1-1.html

如果不是此类问题,我们需要您提供一个可以重现问题的Demo,才可以确定是什么问题。
页: [1]
查看完整版本: C1FlexGrid错误“-17”不是属性“ViewportSize”的有效值