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

[Solved] RadDataPager + RadGridView crashes when trying to group

1 Answer 147 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 17 Feb 2011, 02:05 AM
I have a RadGridView control with it's ItemSource set to this ItemsSource="{Binding PagedSource, ElementName=radDataPager}"  then I set the Source of the dataPages to my Collection. This works great I can go to pages etc no problem. Until I try to group by columns. If I'm on the first page everythig works fine. If I switch to a page 2 and beyond I get a crash.

Here is the stack trace:

____ An unhandled exception (‘Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: SystemJnvalidCastException: Unable to cast object of type
‘myUI.l.Changel isV to type Telerik.Windows.DataJGroup’.
at System.Linq.Enumerable.<Castlterator>d_bl’1.MoveNexto
at Telerik.Windows.Data.GroupExtensions.LeaflndexOf(IEnumerable’1
groups, Object item)
at
Telerik.Windows.Data.QueryableCollectionView.G roupedlndexOf(Object
item)
at Telerik.Windows.Data.QueryableCollectionViewlnternallndexOf(Object
item)
at Telerik.Wi ndows.Data.QueryableCollectionViewJndexOf(Object item)
at Telerik.Wi ndows.Data.QueryableCollectionView.MoveCu rrentTo(Object
item)
at Telerik.Wi ndows.Data.DataltemCol lection.MoveCu rrentTo(Object item)
at
Telerik.Windows.Data.DataltemCollection.UpdateCurrentltemFromSource...
at
Telerik.Windows.Data.DataltemCollection.HandleCu rrenthemChangeOfSo...
sender, EventArgs args)
at
Telerik.Windows.Data.DataltemCol lection,Telerik.Wi ndows.Data.lWeakEve...
sender, EventArgs args)
at Telerik.Windows.Data.WeakEvent.WeakListener’1.Ha ndler(Object
sender, TArgs args)
at Telerik.Windows.Data.QueryableCollectionView.RaisePageChangedo
at
Telerik.Windows.Data.QueryableCollectionView.CompletePageMove(1nt32
newPagelndex)
at
Telerik.Windows.Data.QueryableCollectionView.MoveToPageCore(1nt32
pagelndex)
at Telerik.Wi ndows.Data.QueryableCollectionView.MoveToPage(1nt32
pagelndex)
at Teleri k.Wi ndows.Data.QueryableCollectionView.End DeferQ
at Teleri k.Wi ndows.Data.QueryableCollectionView.DeferHelper.DisposeQ
at Telerik.Windows.Data.DataltemCollection.EndDeferO
at Telerik.WindowsData.DataltemCollection.DeferHelper.DisposeO
at
Telerik.Windows.Controls.GridView.GridViewDataControl.PerformGroupin...
descriptor, Nullable’1 insertionlndex, GroupingEventAction action)
at
Telerik.Windows.Controls.GridView.GridViewDataControl.< > c_DisptayCl...
at





 

 

 


1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Feb 2011, 10:03 AM
Hello Dan,

Can you try to bind them in the opposite way. In other words, bind the grid to the original collection and then bind the pager to RadGridView.Items.

Is there a change in the behavior?

All the best,
Ross
the Telerik team
Tags
DataPager
Asked by
Dan
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or