The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I put a Summary column on the SalesPrice and AmountAlreadyCharge column
What I would like to do for the AlreadyChargePourcentage column is to take the total the AmountAlreadyCharge column divide by the total of the SalesPrice column
How can I do that by programmation? Is that possible?
ADAdministrator Syncfusion Team May 28, 2008 01:02 PM UTC
One way you can do this is to add a 'placeholder summary' where you want to see the custom calculation. Then handle the QueryCellStyleInfo event and explicitly provide the value of this placeholder summary at the proper time. Here is a minimal sample that shows this technique. http://www.syncfusion.com/support/user/uploads/CustomSummary_56e925f5.zip
GCGilles CarreauMay 28, 2008 08:44 PM UTC
Hi,
I try to use your code sample in my project It look like i dont have the right version of the grouping control
Is that possible ? My version is 2.1.0.9
Does your sample should work with this version?
This line does not pass the compilation TypeOf e.TableCellIdentity.DisplayElement Is GridSummaryRow
The compiler say that a DisplayElement can never be a gridSummaryRow
What do you think?
Thanks in advance
ADAdministrator Syncfusion Team May 28, 2008 10:25 PM UTC
I am using 6.3.0.6, the latest version.
Here is a VB snippet that works for me with the 6.3.0.6 version. Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs) 'If TypeOf e.TableCellIdentity.DisplayElement Is GridSummaryRow AndAlso Not (e.TableCellIdentity.SummaryColumn Is Nothing) AndAlso e.TableCellIdentity.SummaryColumn.Name = "sumCol1" Then If Not (e.TableCellIdentity.SummaryColumn Is Nothing) AndAlso e.TableCellIdentity.SummaryColumn.Name = "sumCol1" Then
Dim row As GridSummaryRow = e.TableCellIdentity.DisplayElement '
e.Style.BackColor = Color.LightGoldenrodYellow Dim dCol2, dCol3 As Double If Double.TryParse(GridEngine.GetSummaryText(row.ParentGroup, "sumRow", "sumCol2"), dCol2) And Double.TryParse(GridEngine.GetSummaryText(row.ParentGroup, "sumRow", "sumCol3"), dCol3) And Math.Abs(dCol3) > 0.0000001 Then e.Style.CellValue = dCol2 / dCol3 End If End If End Sub 'gridGroupingControl1_QueryCellStyleInfo
GCGilles CarreauMay 29, 2008 12:33 PM UTC
Hi,
I already try this code yesterday Like I said it does not pass the compilation
I have an old version of the grid Syncfusion so that might be the problem