Hi Mike,
I have a performance problem when I add a Formula on 6 static columns and 10 dynamic columns. When I change a value in my grid it tooks 5 seconds to the grid to update the total of the actual column. So before I can change or enter a new value in another column I always have to wait 5 seconds which is to long. If a deactivate those Summary column then if a change a value in the grid it took less the 1 second. I send you my code that create the formula.I use a formula because in certain columns there are some value that I dont want to summarize. So in the formula I substract this value to obtain the result that i want. The total value per colum that I have to substract are in the DataTableTermePoGroupByYearAndMonth object which is a DataTable that I convert later on in a DataView to filter on a specific month
Is there something I do wrong that can explain why it is so long to update the value into the summary column?
Thanks in advance !
Private Sub gridGestionProjetExecution_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles gridGestionProjetExecution.InitializeLayout
' On récupère les données des termes de Po groupés par année et mois et les déposes son dataTable
m_DataTableTermePoGroupByYearAndMonth = CGestionPrjInfragistic.GetTermesPOGroupByYearAndMonth(CodeProjet, m_gridStartDate)
' On assigne le CalcManager qui est nécessaire si on utilise lne formule pour la sommation de la colonne
gridGestionProjetExecution.CalcManager = myCalcManager
gridGestionProjetExecution.DisplayLayout.ViewStyle = ViewStyle.MultiBand
' Formula is created in this Sub routine (see lower for the code of this sub routine)
CalculerTotalColonnesSansTermesPo()
'' Set the appearance of the summary footer area.
Me.gridGestionProjetExecution.DisplayLayout.Override.SummaryFooterAppearance.BackColor = Color.White
'' Set the appearance for the caption on top of th summary area.
Me.gridGestionProjetExecution.DisplayLayout.Override.SummaryFooterCaptionAppearance.BackColor = Color.DarkBlue
gridGestionProjetExecution.DisplayLayout.Bands(BAND_NAME_ROOT).SummaryFooterCaption = "Sommaire :"
End Sub
' Déclaration des variables
Dim iTotalAllPoTermeToSubstract As Int32 = 0
Dim myViewTermeGroupByYearAndMonth As DataView = New DataView(m_DataTableTermePoGroupByYearAndMonth)
myViewTermeGroupByYearAndMonth.RowFilter = "Mois = -999999999"
iTotalAllPoTermeToSubstract = 0
If myViewTermeGroupByYearAndMonth.Count > 0 Then
' -999999999 est l'identifiant unique pour le mois que j'ai donné pour récupérer le total de tous les mois
End If
' on se crée une variable de la bande sur laquelle on veux travailler
'************************************************************************************************************************************************
' Ici on simule une sommation car dans les faits il en est rien.
'* On ne fait qu'utiliser la colonne description pour afficher une description par ligne de sommation
myBand.Summaries.Add(COL_NAME_DESCRIPTION, SummaryType.Sum, myBand.Columns(COL_NAME_DESCRIPTION), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_DESCRIPTION).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_DESCRIPTION).DisplayFormat = "Total coûtants :"
myBand.Summaries(COL_NAME_DESCRIPTION).Appearance.TextHAlign = HAlign.Right
' Ici on cumule les totaux de la grille pour les colonnes de gauche en supprimant les total des Termes de Po pour la colonne ImputationFutures
myBand.Summaries.Add(COL_NAME_BUDGET_REVISE, SummaryType.Sum, myBand.Columns(COL_NAME_BUDGET_REVISE), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_BUDGET_REVISE).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_BUDGET_REVISE).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_BUDGET_REVISE).Appearance.TextHAlign = HAlign.Right
' ''La colonne Cumulatif imputé
myBand.Summaries.Add(COL_NAME_CUMULATIF_IMPUTE, SummaryType.Sum, myBand.Columns(COL_NAME_CUMULATIF_IMPUTE), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE).Appearance.TextHAlign = HAlign.Right
' ''La colonne Cumulatif imputé Reconnu comme avancement
myBand.Summaries.Add(COL_NAME_CUMULATIF_IMPUTE_RECONNU_AVANC, SummaryType.Sum, myBand.Columns(COL_NAME_CUMULATIF_IMPUTE_RECONNU_AVANC), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE_RECONNU_AVANC).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE_RECONNU_AVANC).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_CUMULATIF_IMPUTE_RECONNU_AVANC).Appearance.TextHAlign = HAlign.Right
' ''La colonne Reste à imputer
myBand.Summaries.Add(COL_NAME_RESTE_A_IMPUTER, SummaryType.Sum, myBand.Columns(COL_NAME_RESTE_A_IMPUTER), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_RESTE_A_IMPUTER).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_RESTE_A_IMPUTER).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_RESTE_A_IMPUTER).Appearance.TextHAlign = HAlign.Right
' ''La colonne Imputation Future
myBand.Summaries.Add(COL_NAME_IMPUTATION_FUTURE, SummaryType.Formula, myBand.Columns(COL_NAME_IMPUTATION_FUTURE), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_IMPUTATION_FUTURE).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_IMPUTATION_FUTURE).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_IMPUTATION_FUTURE).Appearance.TextHAlign = HAlign.Right
' ''La colonne Delta
myBand.Summaries.Add(COL_NAME_DELTA, SummaryType.Sum, myBand.Columns(COL_NAME_DELTA), SummaryPosition.UseSummaryPositionColumn)
myBand.Summaries(COL_NAME_DELTA).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(COL_NAME_DELTA).DisplayFormat = "{0}"
myBand.Summaries(COL_NAME_DELTA).Appearance.TextHAlign = HAlign.Right
' Ici on cumule les totaux de la grille pour les colonnes de droite en supprimant les total des Termes de Po par mois
' On crée le type de sommation que l'on veut faire soit une formule
myBand.Summaries.Add(i.ToString, SummaryType.Formula, myBand.Columns(i.ToString), SummaryPosition.UseSummaryPositionColumn)
' Réinitialisation de la valeur à soustraire
iTotalPoTermeToSubstract = 0
' SI on a une valeur a soustraire pour la colonne courante
' Ici bottomFixed veut dire que la ligne des totaux sera toujours visible dans le bas de la grille
myBand.Summaries(i.ToString).SummaryDisplayArea = SummaryDisplayAreas.BottomFixed
myBand.Summaries(i.ToString).DisplayFormat = "{0}"
myBand.Summaries(i.ToString).Appearance.TextHAlign = HAlign.Right
Next
yannh said:So before I can change or enter a new value in another column I always have to wait 5 seconds which is to long.
What exactly do you mean by this? Are you saying that the UI is unresponsive? The CalcManager works asynchronously by default. So unless you changed some properties on the CalcManager itself, it should not be locking up the UI.
Or do you just mean you don't want to type until you can see the calculated value?
No I can not type a new value because I dont have the hand on the grid.
I am forced to wait 5 secondes
For exemple I type the value 10 in a column and I press the key Tab to pass to the next cells
Well it took 5 seconds before the cursor appears in the next cells . So until the cursor appears I can not type any new value in anay cells I have to wait. :)
If I deactivate the summary row then everything is normal and fast as it is suppose to when I change a value in a cells
Is there some Properties that I have to use with the CalcManager like Recalc()
When I change a value in the column A does all columns are recalculate or just the A column ?
Thanks in advance
Hm, that's weird. The calculation of summaries should not be locking the UI. Unless you changed some settings on the CalcManager to make it synchronous.
Make sure you have the latest Hot Fix and see if that helps. If not, you should try to duplicate the issue in a small sample project and Submit an incident to Infragistics Developer Support so they can check it out.
I just want to give you some news about my performance problem
I realize when I compile my program in release mode that the performance of the grid is fine like it is suppose to
But in Debug mode it is very slow.
So for now there are no problem for me because on production we are in release mode.
In debug mode we have to wait 5 seconds everytime we make a change in a cells
In release mode it is less than 1 second which is very good.
Does that make sense or give you an idea of why it is so slow in debug mode.?
Thanks a lot for all your support is it appreciate very much
I wish you a nice day!
Hi,
One reason I can think of for something like that to occur is if you are using a lot of Debug statements in your code. Are you using Debug.WriteLine or Debug.Assert in an event that is fired during the calculations?
Another thing you might check is to set the Visual Studio IDE and set it to break on all expections. Perhaps there are exceptions occurring in Debug mode that are being caught and handled, but are slowing down performance. Although, I am not sure why the same exceptions would not slow down performance in Release mode.