We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridGroupingControl more complex expressions in summary...

Hi,

I cannot understand how complex can be the expressions used in summaries. In the documentation we read:

http://help.syncfusion.com/ug/windows%20forms/Documents/listofexpressions.htm

but if I want to calculate the absolute value of a number in my expression and to use it in a summary field, how can I do it?
And if I want to use the if/then/else statement?
Does the expression system of GridGroupingControl support formula as in GridControl?

Thanks.

4 Replies

AG Anish George Syncfusion Team June 23, 2015 01:31 PM UTC

Hi Maurizio,

Thank you for your interest in Syncfusion products.

Could you please give us more details on your query and on which scenario you are using this so that it would be helpful for us to give you a quick solution. Regarding the Forumula support, GridGroupingControl supports Formula cell type like in GridControl. If you are looking on how to create custom summary then we suggest you to look into the below link for more details.

http://help.syncfusion.com/ug/windows%20forms/index.html#!Documents/customsummary.htm

Please let us know if you need any further assistance.

Regards,
Anish.


MZ maurizio ziraldo June 24, 2015 07:45 AM UTC

Hi,

I attached a modified version of your IBindingList demo with what I need to do with summaries (see comments).
I had already read the documentation on custom summaries, but I don't understand if I need them in may case.
Thanks.

Attachment: bindinglistdemo_4da8a222.zip


AG Anish George Syncfusion Team June 25, 2015 12:13 PM UTC

Hi Maurizio,

 We suggest you to use the QueryCellInfoStyle event for achieving your query. By using this event you can get access of the summary cell and you can change the cell type of that particular cell. Please refer the below KB link for making the Summary cell type to Formula CellType. Also refer the below code for your reference.

VB:

Me.gridGroupingControl1.QueryCellStyleInfo += gridGroupingControl1_QueryCellStyleInfo
Public Sub gridGroupingControl1_QueryCellStyleInfo(sender As Object, e As GridTableCellStyleInfoEventArgs)
Select Case e.TableCellIdentity.TableCellType
Case GridTableCellType.GroupCaptionSummaryCell
If True Then
If e.TableCellIdentity.SummaryColumn IsNot Nothing AndAlso e.TableCellIdentity.SummaryColumn.Name = "Sum3" Then
Dim row As GridSummaryRow = TryCast(e.TableCellIdentity.DisplayElement, GridSummaryRow)
e.Style.CellType = GridCellTypeName.FormulaCell
e.Style.CellValue = "=5+5"//Required Formula
End If
Exit Select
End If
End Select
End Sub


KB link:

http://www.syncfusion.com/kb/4571/how-to-customize-the-summary-column-for-specific-rows         

 Please let us know if you need any further assistance.

 Regards,
 Anish.


AG Anish George Syncfusion Team June 25, 2015 12:13 PM UTC

Hi Maurizio,

 We suggest you to use the QueryCellInfoStyle event for achieving your query. By using this event you can get access of the summary cell and you can change the cell type of that particular cell. Please refer the below KB link for making the Summary cell type to Formula CellType. Also refer the below code for your reference.

VB:

Me.gridGroupingControl1.QueryCellStyleInfo += gridGroupingControl1_QueryCellStyleInfo
Public Sub gridGroupingControl1_QueryCellStyleInfo(sender As Object, e As GridTableCellStyleInfoEventArgs)
Select Case e.TableCellIdentity.TableCellType
Case GridTableCellType.GroupCaptionSummaryCell
If True Then
If e.TableCellIdentity.SummaryColumn IsNot Nothing AndAlso e.TableCellIdentity.SummaryColumn.Name = "Sum3" Then
Dim row As GridSummaryRow = TryCast(e.TableCellIdentity.DisplayElement, GridSummaryRow)
e.Style.CellType = GridCellTypeName.FormulaCell
e.Style.CellValue = "=5+5"//Required Formula
End If
Exit Select
End If
End Select
End Sub


KB link:

http://www.syncfusion.com/kb/4571/how-to-customize-the-summary-column-for-specific-rows         

 Please let us know if you need any further assistance.

 Regards,
 Anish.

Loader.
Live Chat Icon For mobile
Up arrow icon