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

InvalidOperationException on GridViewItemContainerGenerator.StartAt

3 Answers 134 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 05 Jul 2011, 06:30 PM
Hello,

I've recently encountered a problem with the GridView where I get an InvalidOperationException when the grid is refreshing after changing the number of child elements on an item that already has elements and is expanded and visible within the GridView.  It doesn't matter whether I'm increasing or decreasing the number of child elements. My stack trace is as follows :

>   Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(System.Windows.Controls.Primitives.GeneratorPosition position, System.Windows.Controls.Primitives.GeneratorDirection direction, bool allowStartAtRealizedItem) + 0x5d bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(System.Windows.Size constraint) + 0xdc7 bytes
    PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x1d6 bytes 
    PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x207 bytes 
    PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() + 0x1d9 bytes  
    PresentationCore.dll!System.Windows.UIElement.UpdateLayout() + 0x16 bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.RadTreeListView.RestoreFocusedCell() + 0x53 bytes   
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.TreeListView.TreeListViewRow.OnIsExpandedChanged(bool oldValue, bool newValue) + 0xca bytes 
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewRow.OnIsExpandedChanged(System.Windows.DependencyObject dependencyObject, System.Windows.DependencyPropertyChangedEventArgs e) + 0x129 bytes   
    WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4c bytes
    PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes  
    WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3c bytes  
    WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x723 bytes  
    WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) + 0x2eb bytes 
    WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0x35 bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewRow.IsExpanded.set(bool value) + 0x4d bytes
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.RadTreeListView.PrepareContainerForItemOverride(System.Windows.DependencyObject element, object item) + 0x148 bytes 
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.PrepareItemContainer(System.Windows.DependencyObject container, object item) + 0x8c bytes
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(System.Windows.DependencyObject container) + 0x52 bytes 
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(int childIndex, System.Windows.UIElement container, bool isRecycled) + 0x191 bytes   
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertNewContainer(int childIndex, System.Windows.UIElement container) + 0x2b bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(int childIndex, System.Windows.UIElement child, bool newlyRealized) + 0xb1 bytes   
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.BringIndexIntoView(int index) + 0x17f bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewRecursive(System.Windows.FrameworkElement element, System.Collections.Generic.Stack<object> itemStack, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback) + 0x2b5 bytes  
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoViewInternal(object dataItem, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback) + 0x43 bytes 
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewAsync.AnonymousMethod__4f() + 0x3b bytes 
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0xba bytes
    WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x42 bytes   
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() + 0x8d bytes 
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) + 0x38 bytes
    mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6a bytes   
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0x7e bytes   
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x2c bytes   
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0x68 bytes 
    WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() + 0x15e bytes   
    WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x63 bytes
    WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xbe bytes   
    WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x7d bytes   
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x53 bytes
    WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x42 bytes   
    WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0xb4 bytes   
    WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x104 bytes   


Has anybody run into any similar sounding problems with the GridView ?

Edit: Upon further investigation, I've found that this problem arises in Extended selection mode, Single works just fine. For a bit of clarification, the object with the collection of child elements that's changing must be expanded in the GridView.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Jul 2011, 06:24 AM
Hi,

 Can you post more info about your grid version? 

Best wishes,
Vlad
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Alex
Top achievements
Rank 1
answered on 06 Jul 2011, 04:39 PM
Hi,

I'm using v2010.3.1304.40. Also, here is my XAML usage of the RadTreeListView :
<telerik:RadTreeListView Name="datagrid"
                         BeginningEdit="DataTreeGrid_BeginningEdit"
                         AutoGenerateColumns="False"
                         Grid.Row="1"
                         SelectionMode="Extended">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:RadTreeListView.Resources>
        <Style TargetType="{x:Type telerik:GridViewCell}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=src:MyEditorEditor}, Path=SomeBooleanProperty}" Value="False">
                    <Setter Property="IsEnabled" Value="False" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadTreeListView.Resources>
</telerik:RadTreeListView>

0
Vlad
Telerik team
answered on 07 Jul 2011, 06:37 AM
Hello,

 Can you upgrade to our latest official version - Q1 2011 SP1?

Kind regards,
Vlad
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Alex
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Alex
Top achievements
Rank 1
Share this question
or