I currently am loading a wingrid with about 13000+ rows of data.
I have had up to 30 columns with formulas in them. Some formulas are built off other formulas.
I basically put a progress bar for the user to tell them that the grid is calculating.I need all rows/columns calculated prior to viewing or the summary data will make no sense.
Are there ways to build the formulas to increase calculation speed?
Are there ways to load the grid initially with columns in a specific order that would speed the calculations up?
Are formulas using other formulas not a good way to go or should we have each formula re-run caculations independently instead of building one on the other?
Any suggestions would help.13000 rows by 30 columns could be a small use of the grid. It could grow much more.
Thanks.
Hi
I am having a similar kind of issue where the formula columns take longer to load in the grid. Did you find any resolution to it?
How are you displaying the progress bar in this case?
Speed Issue:I was told to submit a feature request for the speed issue.
I tested my code and I discovered with my grid that the row init event fired off one time for each column with a formula per row in my grid. So, for a 13K * 36 calculated column grid, my row init event fired off about 470K times. When I had no calculated columns, the row init fired off onces per row.
Progress Bar:I first ran a background worker process to run a line of code at timed intervals against my grid.
(Linq statement I ran)
iProgressIndexList.AddRange((
From oItem As UltraGridRow In Me.uGrid.Rows.Cast(Of UltraGridRow)() Where (Not iProgressIndexList.Contains(oItem.Index)) AndAlso ((From oItem2 As UltraGridCell In oItem.Cells.Cast(Of UltraGridCell)() Where ((oItem2.Column.Formula <> String.Empty) AndAlso (IsDBNull(oItem2.OriginalValue)) AndAlso (IsDBNull(oItem2.Value))) Select oItem2).ToList.Count = 0) Select oItem.Index).ToList)
iProgressIndexList is a list of integers.
Basically, if all cells that should be calculated for the row are calculated, then it adds the row index to the list.
The (iProgressIndexList.count / me.uGrid.Rows.Count) * 100 will give me a progress bar value for the user to see.
I know the above line will create overhead due to cell object creation, but it was overhead I could deal with instead of leaving my end users in the dark.
I also later switched part of my code to just access the cells by the column name. I used the columns I knew had formulas. That decreased my memory usage a bit.
Hope that helps or at least gives you some ideas.