Scrolling issue when grouped on multiple columns

8 posts, 2 answers
  1. Valery
    Valery avatar
    7 posts
    Member since:
    Jan 2013

    Posted 19 Feb 2013 Link to this post

    Hi,

    i'm getting a randomly occurring exception when extensively scrolling through the grid that is grouped on 3 or more columns.
    The grid is bound to a source with ca 600 records, other properties are:
                 <localGrid:RadGridView x:Name="SummaryGrid"  Grid.Row="1"
                                             SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                             AutoGenerateColumns="False"
                                             CanUserDeleteRows="False"
                                             CanUserInsertRows="False"
                                             DataLoadMode="Asynchronous"
                                             IsFilteringAllowed="True"
                                             IsReadOnly="True"
                                             ScrollMode="RealTime"
                                             ShowGroupPanel="True"
                                             ShowInsertRow="False"
                                             SelectionMode="Extended"
                                             EnableColumnVirtualization="true"
                                             EnableRowVirtualization="True"
                                             ItemsSource="{Binding WorkItems}"
                                             local:GridViewHeaderMenu.IsEnabled="false"
                                             UserLayouts="{Binding UserLayouts}"
                                             ShowColumnFooters="False"
                                             ShowGroupFooters="False"
                                             IsQuickFilterRowEnabled="True"
                                             IsSynchronizedWithCurrentItem="True"
                                             SelectionUnit="FullRow">

    After I grouped by say 4 or 5 columns, I expand some groups and start scrolling the grid using mouse or page up/ page down keys. If I keep doing that for a 1-2 minutes, I am eventually getting a NullReferenceException from Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.get_LayoutStrategy():

    Message: Unhandled Error in Silverlight Application [Arg_NullReferenceException]

    Arguments:

    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.10411.00&File=mscorlib.dll&Key=Arg_NullReferenceException   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.get_LayoutStrategy()

       at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.SubscribeToGeneratorEvents()

       at Telerik.Windows.Controls.GridView.GridViewBaseVirtualizingPanel.OnLoaded(Object sender, RoutedEventArgs e)

       at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

    Line: 1


    any ideas on what's causing it and how to fix?


     
  2. Valery
    Valery avatar
    7 posts
    Member since:
    Jan 2013

    Posted 19 Feb 2013 Link to this post

    The piece of code that throws the exception:

     
    public partial class GridViewVirtualizingPanel

    {

    ...
            private LayoutStrategyBase LayoutStrategy

            {

                [DebuggerStepThrough]

                get

                {

                    if (this.layoutStrategy == null)

                    {

                        switch (this.ParentGrid.GroupRenderMode)

                        {

                            case GroupRenderMode.Nested:

                                this.layoutStrategy = new NestedLayoutStrategy(this, this.oldScrollData);

                                break;

                            case GroupRenderMode.Flat:

                                this.layoutStrategy = new FlatLayoutStrategy(this, this.oldScrollData);

                                break;

                        }

                    }

     

                    return this.layoutStrategy;

                }

            }
    ...

     

    It looks like in the switch line this.ParentGrid is null.

     

    • Message: Unhandled Error in Silverlight Application [Arg_NullReferenceException]

    Arguments:

    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.10411.00&File=mscorlib.dll&Key=Arg_NullReferenceException at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.get_LayoutStrategy()

    at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.SubscribeToGeneratorEvents()

    at Telerik.Windows.Controls.GridView.GridViewBaseVirtualizingPanel.OnLoaded(Object sender, RoutedEventArgs e)

    at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)

    at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

  3. Answer
    Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 20 Feb 2013 Link to this post

    Hi Valery,

    Could you test your project with DataLoadMode="Synchronous" and with GroupRenderMode="Flat"? Also, you can try our latest internal build and check whether the problem will occur.
     
    Regards,
    Yordanka
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  4. Valery
    Valery avatar
    7 posts
    Member since:
    Jan 2013

    Posted 20 Feb 2013 Link to this post

    Thanks, Yordanka,

    this helped. In fact, just setting GroupRenderMode="Flat" seems to be doing the job.
  5. Valery
    Valery avatar
    7 posts
    Member since:
    Jan 2013

    Posted 20 Feb 2013 Link to this post

    hi Yordanka,

    GroupRenderMode="flat" seems to ruin the group summaries - notice how they went out of place and no longer aligned to their columns.

  6. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Feb 2013 Link to this post

    Hello,

     If you want group header aggregates aligned with your columns I suggest you to check this demo.

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Valery
    Valery avatar
    7 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    This demo is IRRELEVANT.

     The problem is that GroupRenderMode="flat" does not render GroupRowStyle:

                   
    <controls:RadGridView x:Name="CapacityGrid" GroupRowStyle="{StaticResource GridViewGroupRowStyle}"
                          GroupRenderMode="Flat" <<-- with this, the GroupRowStyle above is IGNORED !
                        AutoGenerateColumns="False"
                        IsFilteringAllowed="False"
                        ItemsSource="{Binding UserCapacity}"                           
                        IsReadOnly="True"
                        Visibility="{Binding IsBusy, Converter={StaticResource BoolVisibilityInverseConverter}}"
                        ShowGroupPanel="False"
                        FontSize="9"
                        CanUserFreezeColumns="False"
                        CanUserReorderColumns="False"
                        CanUserSortColumns="False"
                        CanUserResizeColumns="False"
                        RowDetailsTemplate="{StaticResource GridPreviewTemplate}"
                        RowDetailsVisibilityMode="VisibleWhenSelected"
                        RowIndicatorVisibility="Collapsed"
                        SelectionMode="Multiple"
                        ScrollViewer.HorizontalScrollBarVisibility="Hidden">

    See in my screenshot 5, the yellow color is applied via the GroupRowStyle. With the GroupRenderMode=flat this style is ignored and I get the screenshot 6.
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 Feb 2013 Link to this post

    Hi,

    The only official way for aligned group header aggregates is illustrated on the demo I've posted. 

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top