Hello,
I use XamGrid with ItemsSource property bounded on VirtualCollection. ( v11.2 )
VirtualCollection contains EF Enitites.
XamGrid has pager on bottom, grouping bar on top and filtering in first row.
Used ItemDataRequest event calls RIA service to load data and then LoadItems method.
So, data loaded on XamGrid correctly.
But, when I trying to group XamGrid on any column it throws an exception:
Unhandled Error in Silverlight 4 Application Не удалось привести тип объекта 'Infragistics.Controls.Grids.Row' к типу 'Infragistics.Controls.Grids.Primitives.GroupByRow'. в Infragistics.Controls.Grids.XamGrid.WalkDownGroupByRowsForDataItem(RowCollection rows, Object data)
в Infragistics.Controls.Grids.XamGrid.ActiveItemChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
в System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
в System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
в System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
в Infragistics.Controls.Grids.XamGridRowsManager.OnCurrentItemChanged(Object data)
в Infragistics.Controls.Grids.RowsManager.DataManager_CurrentItemChanged(Object sender, CurrentItemEventArgs e)
в Infragistics.DataManagerBase.OnCurrentItemChanged(Object item)
в Infragistics.DataManagerBase.ICollectionViewData_CurrentChanged(Object sender, EventArgs e)
в Infragistics.Collections.VirtualCollection`1.OnCurrentChanged(EventArgs args)
в Infragistics.Collections.VirtualCollection`1.set_CurrentItem(Object value)
в Infragistics.Collections.VirtualCollection`1.MoveCurrentToPosition(Int32 position)
в Infragistics.Collections.VirtualCollection`1.ClearCachce()
в Infragistics.Collections.VirtualCollection`1.ResetCacheAndDataRequests()
в Infragistics.Collections.VirtualCollection`1.ReloadCurrentView()
в Infragistics.Collections.VirtualCollection`1.StopDeferRefresh()
в Infragistics.Collections.DeferredRefresh`1.Dispose()
в Infragistics.DataManager`1.ResolveFilteredSortedPagedDataSource()
в Infragistics.DataManagerBase.InvalidateSortedFilterdDataSource()
в Infragistics.DataManagerBase.ClearCachedDataSource(Boolean invalidateTotalRowCount)
в Infragistics.DataManager`1.ClearCachedDataSource(Boolean invalidateTotalRowCount)
в Infragistics.Controls.Grids.RowsManager.InvalidateSort()
в Infragistics.Controls.Grids.RowsManager.InvalidateGroupBy(Boolean reset)
в Infragistics.Controls.Grids.XamGridRowsManager.InvalidateGroupBy(Boolean reset)
в Infragistics.Controls.Grids.RowsManager.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName)
в Infragistics.Controls.Grids.XamGridRowsManager.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName)
в Infragistics.Controls.Grids.RowsManagerBase.OnColumnLayoutPropertyChanged(Object sender, PropertyChangedEventArgs e)
в System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
в Infragistics.DependencyObjectNotifier.OnPropertyChanged(String propertyName)
в Infragistics.Controls.Grids.ColumnLayout.InvalidateGroupBy()
в Infragistics.Controls.Grids.GroupByColumnsCollection.OnGroupingChanged(IList`1 oldCollection, IList`1 newCollection)
в Infragistics.Controls.Grids.GroupByColumnsCollection.AddItem(Int32 index, Column item)
в Infragistics.Collections.CollectionBase`1.Add(T item)
в Infragistics.Controls.Grids.Column.set_IsGroupBy(Boolean value)
в Infragistics.Controls.Grids.Primitives.HeaderCellControl.OnMouseLeftButtonUpColumnMoving(MouseButtonEventArgs e)
в Infragistics.Controls.Grids.Primitives.CellControlBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
в System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
в MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
May be there is any workaround?
BR,
Alexey Lukyanov
I know that one problem I have run into is that if the grid is in edit mode, and you attempt to sort a column you will get an exception, so when editing a cell I have to disable all sorting and filtering. Perhaps that may be your issue?
No, grid is not in edit mode.
Hi,
Thanks you for the sample. I was able to reproduce the behavior.
I am in the process of logging this as a development issue. I have also created a case for you so that I can contact you directly concerning the status of that development issue thru that case.
You will hear from me shortly.
I have added an project example. (I did not add Infragistics assemblies because of file size, so please add infragistics 11.2 references)
So, when you group any column, application throws an exception (see above).
Please, give me any ideas how I can solve this issue.