Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Performance of WinGrid Group By
posted

Hi,

I am working on an application that uses an ultrawingrid attached to a DataView

which is subsequently looking at a DataTable.

I am making use of the ultragrid group by facility to aggregate the figures in the grid.

However, I have some concerns over the performance of using group by. The data in the DataTable

could potentially be updated many times a second. Another option is to use another DataTable with a

data relation to the previous table and use the "expression" property on a column to do the summations.

However, doing this increases the complexity slightly and I lose some of the flexibility of doing it via the grid.

What do you recommend? I have read the article on performance tips (http://news.infragistics.com/forums/t/15306.aspx)

which will no doubt help. Are there any issues with regard to performance of using the group by in a grid?

Many thanks

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    It's hard for me to be specific here without knowing more about the needs of your application.

    When the data source is updated, the grid cell's will reflect the changes as long as the data source implements IBindingList and notifies the grid of the change. This should not be a problem since you are using a DataView.

    However, the grid will not re-sort or re-group the data when it receives this notification. The grid works this way for a couple of reasons. One is that it would be a weird user experience for a user to enter a value in a cell, tab out of that cell, and have the row suddenly disappear or for the grid to scroll to a new position. Another reason is for a situation like you have here.

    To make the grid re-sort or re-group, you have to use the band.SortedColumns.RefreshSort method. This allow you to have total control over when the grouping and sorting is refreshed.

    My guess is that if you were to respond to the notifications from your data source and refresh the sorting on the grid multiple times per second, it would certainly be a huge performance problem and the application would be unusable.

    Is the data that is changing going to affect the grouping at all? If so, the question is, how often do you want the grid to refresh the grouping?  Perhaps you could use a timer and do this every few seconds. This could still be a problem if you have a lot of rows, as the application might freeze every time the sorting is refreshed.

Reply Children