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
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.
From version 10 of the winforms library, the GroupBy functionality to refresh has not worked. i.e.
My ultragrid relied on this functionality when some data is changed on a row and i expect the data to move into the correct group. Instead the data is changed but it is still grouped under the wrong group.
e.g. Imagine having data rows with two columns, index and title and the ultrawingrid is grouped by the index from 1 to 10. If the row changes from 1 to 2 for example, that row stays in the group for 1.
Thanks,
Richard
If you are calling band.SortedColumn.RefreshSort(true) and the rows are not moving to the correct groups, then that is obviously a bug.
But we are not currently aware of any such bugs in the grid. Can you post a small sample project demonstrating this behavior?