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

Gridview performance with grouping very slow

9 Answers 441 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 07 Jan 2011, 04:20 PM
Hey there, having a performance issue when grouping is enabled. I do not believe it is the grouping logic, but perhaps a drawing issue. I have about 1800 items of 10 columns that are sorted and grouped (about 12 groups). When grouping is off, it runs very fast. With grouping on, it is painfully slow reacting to commands and changes in the bindinglist. However... if I keep most groups collapsed it runs fast again, which is what leads me to believe it may be redrawing (formatting, etc.) rows that are not visible to the user.

For now I will default the groups to collapsed, but would love some feedback on handling this performance issue when all groups are opened. I can only imagine a user with 5000+ items.

Thanks!

9 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 04:35 PM
Hi Brandon,

I've prepared a small sample. I notice a slight performance decrease but could you specify in which areas exactly you are having the issue? Feel free to alter the sample to closer reflevt your scenario and re-post, and if I can help, I will.
Imports Telerik.WinControls.Data
Imports System.ComponentModel
  
Public Class Form1
  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.RadGridView1.EnableGrouping = True
        Me.RadGridView1.ShowGroupPanel = True
        Me.RadGridView1.AutoExpandGroups = True
  
        Me.Populate()
  
        Dim descriptor As New GroupDescriptor()
        descriptor.GroupNames.Add("Col1", ListSortDirection.Ascending)
        Me.RadGridView1.GroupDescriptors.Add(descriptor)
    End Sub
  
    Private Sub Populate()
        Dim list As New List(Of MyObject)
        For i As Integer = 0 To 1800
            list.Add(New MyObject("Col1" & i.ToString(), "Col2" & i.ToString(), "Col3" & i.ToString(), "Col4" & i.ToString(), "Col5" & i.ToString(),
                                  "Col6" & i.ToString(), "Col7" & i.ToString(), "Col8" & i.ToString(), "Col9" & i.ToString(), "Col10" & i.ToString()))
        Next i
  
        Me.RadGridView1.DataSource = list
    End Sub
End Class
  
Public Class MyObject
  
    Public Sub New(ByVal col1 As String, ByVal col2 As String, ByVal col3 As String, ByVal col4 As String,
                   ByVal col5 As String, ByVal col6 As String, ByVal col7 As String, ByVal col8 As String,
                   ByVal col9 As String, ByVal col10 As String)
  
        Me.Col1 = col1
        Me.Col2 = col2
        Me.Col3 = col3
        Me.Col4 = col4
        Me.Col5 = col5
        Me.Col6 = col6
        Me.Col7 = col7
        Me.Col8 = col8
        Me.Col9 = col9
        Me.Col10 = col10
    End Sub
  
    Public Property Col1 As String
    Public Property Col2 As String
    Public Property Col3 As String
    Public Property Col4 As String
    Public Property Col5 As String
    Public Property Col6 As String
    Public Property Col7 As String
    Public Property Col8 As String
    Public Property Col9 As String
    Public Property Col10 As String
End Class

All the best
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 04:43 PM
Hi again,

Actually, I have noticed that the more groups I add, the slower it becomes. I will look into this, but I am not sure if there will be a way to speed this up.
Richard
0
Brandon
Top achievements
Rank 1
answered on 07 Jan 2011, 05:21 PM
Hey Richard, thanks for the replies. To better clarify the situation I'll add a few things:

First, only 5 columns are actually displayed. The grouping column (among others used for filtering) are not visible.

The test I'm running right now only has 10 groups, but still over 1800 items split among them. In essence, the app I'm building is an Outlook style, with the groups being split by date type (Today, Yesterday, Last Week, etc.) and folders in a treeview on the left.

Just about anything I do is slow with the groups expanded. Changing folder (filtering), removing item(s), even changing a single email to read/unread takes about 2 seconds. Without groups enabled it's about half a second. So we're adding a 3x overhead in that case?
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 05:28 PM
Hi Brandon,

Yes, In my view it's the grouping that is slow. With 3 groups, 1800 rows, 10 columns, I can scroll quickly, but and move between editable cells quickly, but as soon as I edit a cell and change the value, the next operation is very slow. I'll have a look into this further for you, and try and alter my sample to be closer to yours, but I think this will be something that will have to be addressed internally to the grid. I can understand why it may be slower though. Each time a value is edited, the grid (I presume) is having to check the values to see which group they should belong to.
I'll let you know if I come up with anything
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 06:23 PM
Hi again,

To make sure it was nothing that you or I were doing I've tested this in the demo applications that are installed with the controls.
If you go to The Demos >> Grid View >> Performance >> Load 50,000 rows. And then drag the group to group by the first two columns, then editing cells is slow.
I'll report this in a Telerik Support ticket and post any update here.
regards,
Richard
0
Brandon
Top achievements
Rank 1
answered on 07 Jan 2011, 06:25 PM
Thanks Richard! I've posted a ticket as well moments before your post. Perhaps it will help expedite the resolution of this issue.
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 06:26 PM
In that case, my apologies to Telerik for double posting
for reference the ticket id is: 382181
Regards,
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 10 Jan 2011, 01:07 PM
Hello,

For reference to anyone reading this, this is to be addressed in the Q1 2011 release. The PITS link to the issue for voting and tracking can be found here
Regards,
Richard
0
Brandon
Top achievements
Rank 1
answered on 10 Jan 2011, 06:06 PM
Thanks again for the help, Ricahrd. The PUTS title states the issue is with 2 or more columns, but I get the performance drop with only 1 and 1800 rows. So hopefully the issues are related.
Tags
GridView
Asked by
Brandon
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Brandon
Top achievements
Rank 1
Share this question
or