gpt4 book ai didi

c# - 重现异常:指定的参数超出有效值范围。参数名称:索引

转载 作者:行者123 更新时间:2023-12-02 02:06:47 26 4
gpt4 key购买 nike

我们经常为DataGrid遇到此异常,并且试图重现它,但是我们无法找到导致此问题的原因。

StackTrace可能是这样的:

System.Windows.Controls.ItemCollection.GetItemAt(Int32索引)System.Windows.Controls.VirtualizedCellInfoCollection.Contains(DataGridCell单元格)System.Windows.Controls.DataGridCell.PrepareCell(对象项目,DataGridRow ownerRow,Int32索引)zh_cn系统。 Windows.Controls.DataGridCell.PrepareCell(Object item,ItemsControl cellsPresenter,DataGridRow ownerRow)zh-CN System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject容器,Object项)zh_cn System.Windows.Controls.ItemContainerGenerator .OnItemReplaced(Object oldItem,Object newItem,Int32索引)zh-cn System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender,NotifyCollectionChangedEventArgs args)zh-CN System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType,Object sender,EventArgs e)System.Windows.WeakEventManager.DeliverEventToList(对象发送者,EventArgs args,ListenerList列表)zh_cn System.Wind ows.WeakEventManager.DeliverEvent(Object sender,EventArgs args)zh-CN System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender,NotifyCollectionChangedEventArgs e)zh-CN System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)zh-CN System.Windows.Controls。 ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(类型managerType,对象发送者,EventArgs e)zh-CN System.Windows.WeakEventManager.DeliverEventToList(对象发送者,EventArgs args,ListenerList列表)zh-CN System.Windows.WeakEventManager.DeliverEvent(对象发送者,EventArgs args)System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args Int32 AdjustedOldIndex Int32 AdjustedNewIndex)System.Windows.Controls。 zh_cn System.Windows.Controls.DataGridRow。 NotifyPropertyChanged(DependencyObject d,字符串propertyName,DependencyPropertyChangedEventArgs e,DataGridNotificationTarget目标)zh-CN System.Windows.Controls.DataGridRow.NotifyPropertyChanged(DependencyObject d,DependencyPropertyChangedEventArgs e,DataGridNotificationTarget目标) )System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)System.Windows.Controls.DataGridRow.OnPropertyChanged(DependencyPropertytyChangedEventArgs e)System.Windows.DependencyPropertyChangedEventArgs e )zh_cn System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,DependencyProperty dp,PropertyMetadata元数据,EffectiveValueEntry oldEntry,EffectiveValueEntry&newEntry, bool(boolean) 值coerceWithDefe rredReference, bool(boolean) 值coerceWithCurrentValue,OperationType operationType)zh-cn System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp,对象值,PropertyMetadata元数据, bool(boolean) 值coerceWithDeferredReference, bool(boolean) 值coerceWithCurrentValue,OperationType operationType, bool(boolean) 值isInternal)对象值)zh_cn System.Windows.Controls.DataGridRow.PrepareRow(对象项,DataGrid owneringDataGrid)zh-CN System.Windows.Controls.DataGrid.PrepareContainerForItemOverride(DependencyObject元素,对象项)zh-CN System.Windows.Controls.ItemsControl.MS.Internal。 Controls.IGeneratorHost.PrepareItemContainer(DependencyObject容器,对象项)zh-CN System.Windows.Controls.VirtualizingStackPanel.InsertContainer(Int32 childIndex,UIElement容器,Boolean isRecycled)zh-CN System.Windows.Controls.VirtualizingStackPanel.AddContainerFromGenerator(Int32 childIndex,UIElement子级,Boolean新实现的)System.Windows.C ontrols.VirtualizingStackPanel.GeneratePreviousChild(Int32 childIndex,Size layoutSlotSize)zh-CN System.Windows.Controls.VirtualizingStackPanel.EnsureTopCapGenerated(Size布局SlotSize)zh-CN System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size约束)en System.Windows.Controls.Primitives.DataGridRowsPresenter .MeasureOverride(大小约束)zh-CN System.Windows.FrameworkElement.MeasureCore(大小availableSize)zh-CN System.Windows.UIElement.Measure(大小availableSize)zh-CN System.Windows.ContextLayoutManager.UpdateLayout()zh-CN System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)en System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()en System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)en System.Windows.Threading.ExceptionWrapper .InternalRealCall(Delegate回调,Object args,Int32 numArgs)zh-CN MS.Internal.Threading.Exc eptionFilterHelper.TryCatchWhen(对象源,委托(delegate)方法,对象args,Int32 numArgs,委托(delegate)catchHandler)

或者这个:

在System.Windows.Controls.VirtualizedCellInfoCollection.Contains(DataGridCell单元)在System.Windows.Controls.DataGridCell.PrepareCell(对象项,DataGridRow ownerRow,Int32索引)在System.Windows.Controls.ItemCollection.GetItemAt(Int32索引) System.Windows.Controls.Primitives.DataGridCellsPresenter.SyncProperties(Boolean forcePrepareCells)(System.Windows.Controls.DataGridRow.SyncProperties(Boolean forcePrepareCells))上的.Windows.Controls.DataGridCell.PrepareCell(Object item,ItemsControl cellsPresenter,DataGridRow ownerRow) System.Windows.Controls.DataGrid.PrepareContainerForItemOverride(DependencyObject元素,对象项)的System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer的.Windows.Controls.DataGridRow.PrepareRow(Object项,DataGrid owningDataGrid) (DependencyObject容器,Object项)位于System.Windows.Controls.VirtualizingStackPanel.InsertContainer(Int32 childIndex,UIElement容器, bool(boolean) 值isRe System.Windows.Controls.VirtualizingStackPanel.AddContainerFromGenerator(Int32 childIndex,UIElement child,Boolean newized)在System.Windows.Controls.VirtualizingStackPanel.GeneratePreviousChild(Int32 childIndex,Size layoutSlotSize)在System.Windows.Controls.VirtualizingStackPanel.EnsureTopCapGenerated( System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(大小约束)在System.Windows.Controls.Primitives.DataGridRowsPresenter.MeasureOverride(大小约束)在System.Windows.FrameworkElement.MeasureCore(大小可用)在System.Windows。在System.Windows.Media.MediaContext处,System.Windows.Context.Manager.UpdateLayout()在System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg),在System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()处的UIElement.Measure(Size availableSize)。 System.Windows.Media.MediaContext.RenderMessageHandler(Object re)上的RenderMessageHandlerCore(Object resizedCompositionTarget) (System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate回调,Object args,Int32 numArgs)at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source,Delegate method,Object args,Int32 numArgs,Delegate catchHandler)

我们发现了一些有关EnableColumnVirtualization的帖子(设置为false),但这无济于事,我们仍然遇到相同的异常。关于如何重现或修复此异常,我们几乎没有想法。是否有人对如何解决此问题有想法?

最佳答案

关于c# - 重现异常:指定的参数超出有效值范围。参数名称:索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11511524/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com