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.
Unfortunately, activation email could not send to your email. Please try again.

Summary Rows Calcaulation

Thread ID:

Created:

Updated:

Platform:

Replies:

30593 Jun 20,2005 10:55 PM Jul 21,2005 06:25 AM Windows Forms 8
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On June 20, 2005 10:55 PM

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 12:45 AM

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 11:51 AM

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 12:10 PM

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 03:39 PM

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 09:02 AM

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 03:11 PM

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 20, 2005 11:10 PM

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 06:25 AM

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.

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.

;