RadDataPager + RadGridView crashes when trying to group

2 posts, 0 answers
  1. Dan
    Dan avatar
    3 posts
    Member since:
    Feb 2011

    Posted 16 Feb 2011 Link to this post

    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





     

     

     


  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Feb 2011 Link to this post

    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
  3. DevCraft banner
Back to Top