Hi all,
I am trying to see if I can improve the performance of adding default summaries to multiple int/decimal column using code behind. It is all working fine, but the performance tails off dramatically when the number of columns gets above about 50. In an extreme test, adding summaries to 300 columns (I said extreme...) it takes around 30 seconds on a very fast machine with CPU pegging fully.
I have tried binding the itemsource to an empty list of the appropriate object and then doing the summaries but it doesnt seem to help. Are there any performance improvements anyone can suggest to speed this up?
The code to add summaries is below:
private void SetupColumnSummaries(){ foreach (Column col in this.MyDataGrid.Columns) { if (col.DataType == typeof(Int32) || col.DataType == typeof(decimal) || col.DataType == typeof(double)) { var summary = col.SummaryColumnSettings.SummaryOperands[3]; summary.FormatString = "{0:N0}"; summary.IsApplied = true; } else { col.IsSummable = false; } }}
The most likely cause is that every time you add a summary the summary will force the grid to reprocess it's data. As such you would propably want to set up your columns prior to binding to your data, even better if you could set it up in XAML.
Otherwise at this time there is not much that can be done.
i will have support open a ticket on this issue.
Hi Darrell,
Yes I have already assigned an empty list of items when adding the summary columns but it is still incredibly slow.
So please go ahead and open a support issue.
Regards,Doug
Hi Doug,
I am working on this case for you .
Can you send me that sample
SIncerely, Matt Developer Support Engineer