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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Summary Rows Calcaulation

Thread ID:

Created:

Updated:

Platform:

Replies:

30593 Jun 21,2005 02:55 AM UTC Jul 21,2005 10:25 AM UTC WinForms 8
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On June 21, 2005 02:55 AM UTC

i have 3 summary row, e.g: sumrow1(sum if col["DataeType"]=1) : 10 20 30 sumrow2(sum if col["DataeType"]=2) : 5 10 3 i want to add a summary row sumrow3(sumrow2/sumrow1):0.2 0.5 0.1 how can i do? Thanks!

Administrator [Syncfusion]
Replied On June 21, 2005 04:45 AM UTC

Cradle, for the first two summary rows you need to create a custom summarydescriptor. See the CustomSummaries example for creating custom summaries. In the ctor for the custom symmary you can check for the criteria you have, e.g. "if (col["DataType"] = 1) and return the corret value for that specific row. For the third row, you should create an empty third GridSummaryRowDescriptor. This will reserve space for an empty row below the two summary rows. To fill this row with cell values you can use QueryCellInfo and assign the cell value to e.Style.CellValue together with additional formatting. This is similar to what is shown in the CustomSectionInGroup example, in its gridGroupingControl1_QueryCellStyleInfo method. But instead of checking for if (el is ExtraSection) you should check for GridSummaryRow sr = el as GridSummaryRow; if (sr != null && sr.SummaryRowDescriptor == "nameOfyourThirdSummaryRow") Stefan >i have 3 summary row, >e.g: >sumrow1(sum if col["DataeType"]=1) : 10 20 30 >sumrow2(sum if col["DataeType"]=2) : 5 10 3 > >i want to add a summary row > >sumrow3(sumrow2/sumrow1):0.2 0.5 0.1 > >how can i do? >Thanks! >

Administrator [Syncfusion]
Replied On July 19, 2005 03:51 PM UTC

For the third row, in gridGroupingControl1_QueryCellStyleInfo Method ,Can u give me more code for it? GridSummaryRow sr = el as GridSummaryRow; ??????

Administrator [Syncfusion]
Replied On July 19, 2005 04:10 PM UTC

How to create an empty third GridSummaryRowDescriptor? >Cradle, > >for the first two summary rows you need to create a custom summarydescriptor. See the CustomSummaries example for creating custom summaries. > >In the ctor for the custom symmary you can check for the criteria you have, e.g. "if (col["DataType"] = 1) and return the corret value for that specific row. > >For the third row, you should create an empty third GridSummaryRowDescriptor. This will reserve space for an empty row below the two summary rows. > >To fill this row with cell values you can use QueryCellInfo and assign the cell value to e.Style.CellValue together with additional formatting. This is similar to what is shown in the CustomSectionInGroup example, in its gridGroupingControl1_QueryCellStyleInfo method. But instead of checking for > if (el is ExtraSection) >you should check for > >GridSummaryRow sr = el as GridSummaryRow; >if (sr != null && sr.SummaryRowDescriptor == "nameOfyourThirdSummaryRow") > > >Stefan > >>i have 3 summary row, >>e.g: >>sumrow1(sum if col["DataeType"]=1) : 10 20 30 >>sumrow2(sum if col["DataeType"]=2) : 5 10 3 >> >>i want to add a summary row >> >>sumrow3(sumrow2/sumrow1):0.2 0.5 0.1 >> >>how can i do? >>Thanks! >>

Administrator [Syncfusion]
Replied On July 19, 2005 07:39 PM UTC

Hi Cradle, The following code will add an empty one to the SummaryRows collection: this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Empty")); Stefan >How to create an empty third GridSummaryRowDescriptor? > >>Cradle, >> >>for the first two summary rows you need to create a custom summarydescriptor. See the CustomSummaries example for creating custom summaries. >> >>In the ctor for the custom symmary you can check for the criteria you have, e.g. "if (col["DataType"] = 1) and return the corret value for that specific row. >> >>For the third row, you should create an empty third GridSummaryRowDescriptor. This will reserve space for an empty row below the two summary rows. >> >>To fill this row with cell values you can use QueryCellInfo and assign the cell value to e.Style.CellValue together with additional formatting. This is similar to what is shown in the CustomSectionInGroup example, in its gridGroupingControl1_QueryCellStyleInfo method. But instead of checking for >> if (el is ExtraSection) >>you should check for >> >>GridSummaryRow sr = el as GridSummaryRow; >>if (sr != null && sr.SummaryRowDescriptor == "nameOfyourThirdSummaryRow") >> >> >>Stefan >> >>>i have 3 summary row, >>>e.g: >>>sumrow1(sum if col["DataeType"]=1) : 10 20 30 >>>sumrow2(sum if col["DataeType"]=2) : 5 10 3 >>> >>>i want to add a summary row >>> >>>sumrow3(sumrow2/sumrow1):0.2 0.5 0.1 >>> >>>how can i do? >>>Thanks! >>>

Administrator [Syncfusion]
Replied On July 20, 2005 01:02 PM UTC

Can u give me demo code in gridGroupingControl1_QueryCellStyleInfo for this question? To fill this row with cell values you can use QueryCellInfo and assign the cell value to e.Style.CellValue together with additional formatting. This is similar to what is shown in the CustomSectionInGroup example, in its gridGroupingControl1_QueryCellStyleInfo method. But instead of checking for if (el is ExtraSection) you should check for GridSummaryRow sr = el as GridSummaryRow; if (sr != null && sr.SummaryRowDescriptor == "nameOfyourThirdSummaryRow")

Administrator [Syncfusion]
Replied On July 20, 2005 07:11 PM UTC

Here is a little sample showing an empty summary row being populated using QueryCellStyleInfo. http://www.syncfusion.com/Support/user/uploads/GGC_Unbound_88185b74.zip

Administrator [Syncfusion]
Replied On July 21, 2005 03:10 AM UTC

Unbound field is null (My version is 2.0.5.1) i have 3 summary row, e.g: sumrow1(sum if col["DataeType"]=1) : 10 20 30 sumrow2(sum if col["DataeType"]=2) : 5 10 3 i want to add a summary row sumrow3(sumrow2/sumrow1):0.2 0.5 0.1 how can i do it? Thanks! >Here is a little sample showing an empty summary row being populated using QueryCellStyleInfo. > >http://www.syncfusion.com/Support/user/uploads/GGC_Unbound_88185b74.zip > > >

Administrator [Syncfusion]
Replied On July 21, 2005 10:25 AM UTC

At last,I resoved it by using custom Summary

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;