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

Scrolling issue when grouped on multiple columns

7 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Valery
Top achievements
Rank 1
Valery asked on 19 Feb 2013, 11:30 PM
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?


 

7 Answers, 1 is accepted

Sort by
0
Valery
Top achievements
Rank 1
answered on 20 Feb 2013, 02:11 AM

The piece of code that throws the exception:

...
        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)

0
Accepted
Yordanka
Telerik team
answered on 20 Feb 2013, 03:26 PM
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.

0
Valery
Top achievements
Rank 1
answered on 21 Feb 2013, 12:09 AM
Thanks, Yordanka,

this helped. In fact, just setting GroupRenderMode="Flat" seems to be doing the job.
0
Valery
Top achievements
Rank 1
answered on 21 Feb 2013, 01:40 AM
hi Yordanka,

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

0
Accepted
Vlad
Telerik team
answered on 21 Feb 2013, 06:50 AM
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.

0
Valery
Top achievements
Rank 1
answered on 21 Feb 2013, 11:19 PM
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.
0
Vlad
Telerik team
answered on 22 Feb 2013, 06:57 AM
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.

Tags
GridView
Asked by
Valery
Top achievements
Rank 1
Answers by
Valery
Top achievements
Rank 1
Yordanka
Telerik team
Vlad
Telerik team
Share this question
or