Very bad performance in simple grid usage, scrolling and resizing

9 posts, 0 answers
  1. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 19 Dec 2011 Link to this post

    Hello, I am having some serious issues here.

    I have defined this grid:

    <telerik:RadGridView
        x:Name="something"
        ItemsSource="{Binding Events}"
        telerik:Theming.Theme="Windows7"
        ShowGroupPanel="False"
        AutoGenerateColumns="False"
        ScrollMode="Deferred">
        <telerik:RadGridView.ScrollPositionIndicatorTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding ScrollIndicator}" />
            </DataTemplate>
        </telerik:RadGridView.ScrollPositionIndicatorTemplate>
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}" Width="100" />
            <!--<telerik:GridViewDataColumn Header="Artikkel" DataMemberBinding="{Binding Article}" />
            <telerik:GridViewDataColumn Header="Sats" DataMemberBinding="{Binding Batch}" />
            <telerik:GridViewDataColumn Header="Serienummer" DataMemberBinding="{Binding Serial}" />-->
            <telerik:GridViewDataColumn Header="Operasjon" DataMemberBinding="{Binding EventType}" Width="150" />
            <telerik:GridViewDataColumn Header="Startet" DataMemberBinding="{Binding Started}" Width="100" />
            <telerik:GridViewDataColumn Header="Avsluttet" DataMemberBinding="{Binding Ended}" Width="100" />
            <telerik:GridViewDataColumn Header="Status" Width="100">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Status}" HorizontalAlignment="Left" FontWeight="Bold" Foreground="{Binding StatusColor}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn Header="Bruker" DataMemberBinding="{Binding EmployeeID}" Width="100" />
            <telerik:GridViewDataColumn Header="Informasjon" DataMemberBinding="{Binding Information}" Width="300" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

    Using a bog standard ListView, this was performing just fine - but now I am having UI hangs while scrolling (when scrollmode was realtime) and I get a black background inside the window border while resizing..

    What am I missing?

      // Regards, Morten
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 20 Dec 2011 Link to this post

    Hello Morten Nilsen,

    I have tried to reproduce the issue you reported, but unfortunately without any success. Could you take a look at the sample attached and let me know whether you can get the same behavior on it ? Is there something that I am missing ?  

    Best wishes,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 20 Dec 2011 Link to this post

    Hello, thanks for taking the time to look at it.

    I am seeing the exact same behaviour with your sample as my own code.
    Clicking the tray to scroll, there is a noticable delay before the grid scrolls, and resizing the window, I see a black background inside the window.

    // Regards, Morten
  5. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 20 Dec 2011 Link to this post

    I changed the ScrollMode to RealTime, and rapidly scrolled to the top and bottom several times.
    Just like I was experiencing on my own codebase, the drag handle was lagging behind the mouse.

      // Regards, Morten
  6. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 20 Dec 2011 Link to this post

    Breakthrough!
    When I disable virtualization on your sample application, the performance problem goes away!
    But I would expect that to be a bad idea for grids with many rows.

      // Cheers, Morten
  7. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 20 Dec 2011 Link to this post

    Yeah, going back to my application, horizontal scrolling becomes unusable and the application hangs a bit when loading the grid.
    I wouldn't say I have a lot of rows, though - it is less than 200..

      // Regards, Morten
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Dec 2011 Link to this post

    Hello,

    I have made yet another try on the sample I previously attached, but unfortunately I am still not able to reproduce the behavior you described. Could you take a look at this small video illustrating my attempts ? Am I missing something ? Is there anything more that I need to do in order to get the same behavior ? 
    Nevertheless, it is not recommended to turn off the virtualization as the performance of the grid will most probably be degraded.
     

    Greetings,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 03 Jan 2012 Link to this post

    Hello,

    I definitely do not want to turn off virtualization, I merely did so as a step in my testing :)
    For the interim, I opted to use the standard WPF grid.

    In your video, you can spot one of the things I described, the black flash towards the end after you enable real-time scrolling.

    I just now started up my own application without VS attached, and it does appear to be dramatically more well behaved..
    Before doing that, I turned on "Just My Code" and set Data Binding under WPF Trace settings to off for the output window, without that affecting the performance.

    What sort of a computer are you testing these things on?
    This box is a Core2 Duo E8500 with 8GB RAM and 64 bit Windows 7.

      // Regards, Morten
  10. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 03 Jan 2012 Link to this post

    I found the cause!

    My IntelliTrace was set to trace events and call information.
    When I changed it to events only, the performance problem vanished immediately!

      -- Cheers, Morten
Back to Top
UI for WPF is Visual Studio 2017 Ready