System.InvalidOperationException error - Version 3
-
-
Andy
-
-
-
Joined on 06-30-2008
-
-
Posts 7
-
-
|
System.InvalidOperationException error - Version 3
I am receiving the following exception. My datagrid is in a usercontrol which is inside a TabItem. The first time I navigate to the tab, the grid shows up correctly. If I change the object the DataGridcollectionViewSource is bound to (i.e. adding items), the grid will update correctly. After I leave the tab and return to it, I receive the exception after the Loaded event. I am only able to catch the event in App.Application_DispatcherUnhandledException.
System.InvalidOperationException: The GeneratorPosition to remove cannot map to a non-realized item. at Xceed.Wpf.DataGrid.CustomItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.Remove(GeneratorPosition position, Int32 count) at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.CleanupChild(UIElement element) at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.Cleanup() at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
|
|
-
-
Jenny
-
-
-
Joined on 08-27-2007
-
Longueuil, Québec
-
Posts 1,478
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi Andy, I received the same exception this morning and Marcus is investigating the issue :) I will let you know when a fix is available.
Technical Writer - Xceed Software Of all the things I've lost, I miss my mind the most. - Mark Twain
|
|
-
-
Marcus
-
-
-
Joined on 01-25-2007
-
-
Posts 960
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi Andy,
I have been trying to reproduce the issue based on the description you gave, but without success. Can you provide more details (code and XAML) for your UserControl as well as for the Window/Page hosting the UserControl.
Thanks
Marc Laroche Software Developer Xceed Software Inc.
I don’t suffer from insanity, I enjoy every minute of it. - Unknown
|
|
-
-
Andy
-
-
-
Joined on 06-30-2008
-
-
Posts 7
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi, Marcus,
I did try recreating the problem in a simpler app, but have not been able to reproduce it outside of this app. Here is the xaml:
<UserControl x:Class="InGen.Controls.CustomerServices" xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:xcdg=http://schemas.xceed.com/wpf/xaml/datagrid xmlns:common="clr-namespace:InGen.Common;assembly=InGen.Common" xmlns:local="clr-namespace:InGen.Controls" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <UserControl.Resources> <common:ShortDateConverter x:Key="ShortDateConverter" /> <xcdg:DataGridCollectionViewSource x:Key="cvsServices" Source="{Binding Path=MyCustomerServices}"> <xcdg:DataGridCollectionViewSource.ItemProperties> <xcdg:DataGridItemProperty Name="Description" Title="Service" ValuePath="Service.Description" DataType="{x:Type s:String}" /> <xcdg:DataGridItemProperty Name="StartDate" Title="Start Date" ValuePath="StartDate" DataType="{x:Type s:DateTime}" /> <xcdg:DataGridItemProperty Name="FullAddress" Title="Service Address" ValuePath="Service.RealProperty.FullAddress" DataType="{x:Type :String}" IsReadOnly="True" /> <xcdg:DataGridItemProperty Name="MeterName" Title="Meter" ValuePath="Service.Meter.Name" DataType="{x:Type s:String}" sReadOnly="True" /> </xcdg:DataGridCollectionViewSource.ItemProperties> <xcdg:DataGridCollectionViewSource.GroupDescriptions> <xcdg:DataGridGroupDescription PropertyName="FullAddress" /> <xcdg:DataGridGroupDescription PropertyName="MeterName" /> </xcdg:DataGridCollectionViewSource.GroupDescriptions> </xcdg:DataGridCollectionViewSource> </UserControl.Resources> <DockPanel LastChildFill="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom"> <Button Name="btnAddService" Click="btnAddService_Click" Margin="5">Add Service</Button> <Button Name="btnRemoveServices" Click="btnRemoveServices_Click" Margin="5">Remove Selected Services</Button> </StackPanel> <xcdg:DataGridControl Name="grdServices" AutoCreateColumns="False" ItemsSource="{Binding Source={StaticResource cvsServices}}" ItemScrollingBehavior="Immediate" SelectionMode="Extended" ReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" <xcdg:DataGridControl.View> <xcdg:TableView ShowFixedColumnSplitter="False" UseDefaultHeadersFooters="False"> <xcdg:TableView.FixedHeaders> <DataTemplate> <xcdg:ColumnManagerRow AllowSort="False" AllowColumnReorder="False" /> </DataTemplate> </xcdg:TableView.FixedHeaders> <xcdg:TableView.Theme> <xcdg:Office2007BlueTheme /> </xcdg:TableView.Theme> </xcdg:TableView> </xcdg:DataGridControl.View> <xcdg:DataGridControl.Columns> <xcdg:Column Title="Service" FieldName="Description" IsMainColumn="True" /> <xcdg:Column Title="Start Date" FieldName="StartDate" /> </xcdg:DataGridControl.Columns> </xcdg:DataGridControl> </DockPanel> </UserControl>
MyCustomerServices is a DependencyProperty in the user control. I bind the user control's datacontext to itself in the Loaded event handler with: this.DataContext = this;
I found that the problem only occurs if I assign a new value to MyCustomerServices during the loaded event after the initial load:
MyCustomerServices = CurrentCustomer.CustomerServices.ToList();
The loaded event fires each time I switch back to the tab with the control on it, though the error doesn't occur until after the Loaded event handler has finished. I am working around this right now by not setting MyCustomerServices on Loads after the first one.
`Andy
|
|
-
-
Marcus
-
-
-
Joined on 01-25-2007
-
-
Posts 960
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi Andy,
Just wanted to give you an update concerning this issue. While I have not been able to reproduce the issue with the same description/setup as yours, I have been able to reproduce an issue which has the exact same stack trace and a somehow similar series of events. Unfortunately, there is no workaround to prevent the exception. The good news is that the error has been fixed in our code and I am confident that the fix will also address your issue. The fix for the bug will be part of an upcoming service release.
Best regards,
Marc Laroche Software Developer Xceed Software Inc.I don’t suffer from insanity, I enjoy every minute of it. - Unknown
|
|
-
-
Ido
-
-
-
Joined on 02-06-2008
-
-
Posts 20
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi, I am using your DataGridControl class (great work!). I
am using the new card flow 3D view to display list of 4 items. In the
same window I have a button which open another window based on your
selection in the grid. From time to time (but very consistently) I get an InvalidOperationException with the following stack trace. It happen when I select an item and press the button before the animation of the card flow complete. Here is the stack trace: System.InvalidOperationException was unhandled Message="The GeneratorPosition to remove cannot map to a non-realized item." Source="Xceed.Wpf.DataGrid" StackTrace: at Xceed.Wpf.DataGrid.CustomItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.Remove(GeneratorPosition position, Int32 count) at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.CleanupChild(UIElement element) at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.Cleanup() at Xceed.Wpf.DataGrid.Views.TableViewItemsHost.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at DnA.Presentation.App.Main() in C:\Documents and Settings\All Users\Documents\Development\Efron\DnA Project\trunk\DnA\DnA.Presentation\obj\Debug\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
Hope you find the problem. Ido.
|
|
-
-
Marcus
-
-
-
Joined on 01-25-2007
-
-
Posts 960
-
-
|
Re: System.InvalidOperationException error - Version 3
That other window, does it contain a DataGridContriol as well ( that in addition uses TableView ) ??
Marc Laroche Software Developer Xceed Software Inc.
I don’t suffer from insanity, I enjoy every minute of it. - Unknown
|
|
-
-
Anson
-
-
-
Joined on 08-09-2008
-
-
Posts 2
-
-
|
Re: System.InvalidOperationException error - Version 3
I have the same problem like Andy's. I put it into a tabcontrol, exception occured when I return to the tab.
What can I do?
Here is the exception description:
System.InvalidOperationException was unhandled Message="The GeneratorPosition to remove cannot map to a non-realized item." Source="Xceed.Wpf.DataGrid" StackTrace: 在 Xceed.Wpf.DataGrid.CustomItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.Remove(GeneratorPosition position, Int32 count) 在 Xceed.Wpf.DataGrid.Views.CardViewItemsHost.DoCleaning() 在 Xceed.Wpf.DataGrid.Views.CardViewItemsHost.MeasureOverride(Size availableSize) 在 System.Windows.FrameworkElement.MeasureCore(Size availableSize) 在 System.Windows.UIElement.Measure(Size availableSize) 在 System.Windows.ContextLayoutManager.UpdateLayout() 在 System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) 在 System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() 在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() 在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) 在 System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 在 System.Windows.Threading.DispatcherOperation.InvokeImpl() 在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 在 System.Threading.ExecutionContext.runTryCode(Object userData) 在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Windows.Threading.DispatcherOperation.Invoke() 在 System.Windows.Threading.Dispatcher.ProcessQueue() 在 System.Windows.Threading.Dispatcher.WndProcHook(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, Boolean isSingleParameter) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 在 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 在 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 在 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.Threading.Dispatcher.Run() 在 System.Windows.Application.RunDispatcher(Object ignore) 在 System.Windows.Application.RunInternal(Window window) 在 System.Windows.Application.Run(Window window) 在 System.Windows.Application.Run() 在 Booster.Letshow.KOD.MOD.App.Main() 位置 D:\文档\My Project\ITP003--Let'show\Let'show\Letshow.KOD.MOD\obj\Debug\App.g.cs:行号 0 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart() InnerException:
Thanks.
Anson
|
|
-
-
Marcus
-
-
-
Joined on 01-25-2007
-
-
Posts 960
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi Anson,
Information concerning the resolution for this error is already present within the thread.
Here is a wrap-up: Fix has been found, service release will contain the fix.
Marc Laroche Software Developer Xceed Software Inc.
I don’t suffer from insanity, I enjoy every minute of it. - Unknown
|
|
-
-
chris
-
-
-
Joined on 08-22-2008
-
-
Posts 16
-
-
|
Re: System.InvalidOperationException error - Version 3
What is the ETA of the service release? We are trying to choose a grid vendor presently and this has forced my Xceed prototype to a wall?? Are there any know workarounds? Even a hack would do so I could try to continue this effort. Up till this point, Xceed was winning the grid competition, but this is a little harsh.
|
|
-
-
Anson
-
-
-
Joined on 08-09-2008
-
-
Posts 2
-
-
|
Re: System.InvalidOperationException error - Version 3
Hi Marcus, Thanks for your reply,
I don't remember where I modified in the zaml last night, but now, it works well, the error never occurs.
Maybe in <Grid.RowDefinitions> or <Grid.ColumnDefinitions>, the value cannot be set to '*' or 'Auto',
I don't know.
Thanks.
I just use Xceed few days, I think it's good. :)
|
|
-
-
Marcus
-
-
-
Joined on 01-25-2007
-
-
Posts 960
-
-
|
Re: System.InvalidOperationException error - Version 3
The Service Release is to be prepared pretty quickly. It is likely to be released next week.
There are no known workarounds for this issue, but if you can explain to me how your application is using the DataGridControl, then maybe we can find a somehow acceptable "tradeoff" that would not reproduce the issue.
The information I would need is mostly regarding ItemsSource change and loading/unloading of the DataGridControl.
Marc Laroche Software Developer Xceed Software Inc.
I don’t suffer from insanity, I enjoy every minute of it. - Unknown
|
|
-
-
Ido
-
-
-
Joined on 02-06-2008
-
-
Posts 20
-
-
|
Re: System.InvalidOperationException error - Version 3
In my application I'm not doing any of the things you say. I'm not changing the ItemsSource and not loading/unloading the DataGridControl. My window display a grid using the 3D View, then when a button is clicked I change visibility of other control (not the DataGridControl) to Visible and to Hidden. That's it, nothing is changed in the grid itself. Yet, after few show/hide actions I get the exception from the grid. Ido.
|
|
-
-
Jenny
-
-
-
Joined on 08-27-2007
-
Longueuil, Québec
-
Posts 1,478
-
-
|
Re: System.InvalidOperationException error - Version 3
The service release should be available this week or next week at the latest.
Technical Writer - Xceed Software
Of all the things I've lost, I miss my mind the most. - Mark Twain
|
|
-
|
|