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.

SummaryColumn use different Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

75397 Jul 24,2008 05:34 AM Aug 6,2008 03:33 PM ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
Jacky chen
Asked On July 24, 2008 05:34 AM

GGC have 3 columns,I need show SummaryColumn in Col3,but the Col3 sum is Sum(Col1)/Sum(Col2)*100 .
How would I accomplish this? Thanks.


Jacky chen
Replied On July 24, 2008 10:06 PM

And Column 2 is Hidden .

>GGC have 3 columns,I need show SummaryColumn in Col3,but the Col3 sum is Sum(Col1)/Sum(Col2)*100 .
How would I accomplish this? Thanks.




Rajarajeswari S [Syncfusion]
Replied On July 29, 2008 01:26 AM


Hi Jacky,

Thanks for using Syncfusion products.

We can have SummaryRows using SummaryRowDescriptor and SummaryColumnDescriptor with GridGroupingControl. Please refer the below code snippet which illustrates your requirement:

$sfwg:GridSummaryRowDescriptor Name="Sum">
$SummaryColumns>
$sfwg:GridSummaryColumnDescriptor DataMember="Col1" Format="{Sum:#}"
Name="Col1Total" SummaryType="Int32Aggregate" DisplayColumn="Col1">
$/sfwg:GridSummaryColumnDescriptor>
$sfwg:GridSummaryColumnDescriptor DataMember="Col2" Format="{Sum:#}"
Name="Col2Total" SummaryType="Int32Aggregate" >
$/sfwg:GridSummaryColumnDescriptor>
$sfwg:GridSummaryColumnDescriptor Name="Col3AVG" DisplayColumn="Col3" SummaryType="DoubleAggregate">
$/sfwg:GridSummaryColumnDescriptor>
$/SummaryColumns>
$/sfwg:GridSummaryRowDescriptor>
$/SummaryRows>


// finding Average for the column1 and column2.
protected void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
switch (e.TableCellIdentity.TableCellType)
{
case GridTableCellType.SummaryFieldCell:
{
if (e.TableCellIdentity.SummaryColumn.Name == "Col1Total")
{
HTot = Convert.ToInt32(e.Style.CellValue);
}
if (e.TableCellIdentity.SummaryColumn.Name == "Col2Total")
{
IDTot = Convert.ToInt32(e.Style.CellValue);
e.Style.CellValue = HTot / IDTot;
}
if (e.TableCellIdentity.SummaryColumn.Name == "Col3AVG")
{
e.Style.CellValue ="" ;
}


break;
}
}
}

Please refer the sample from the belwo link, which illustrates this:

http://www.syncfusion.com/support/user/uploads/Summary_9c2014ae.zip


Please let me know if you have any other concerns.

Regards,
Raji




Jacky chen
Replied On July 31, 2008 04:40 AM

Sorry! I use visual studio 2005 , the sample can not run.


Jacky chen
Replied On July 31, 2008 04:43 AM

the key point is I can't hide col 2.



Rajarajeswari S [Syncfusion]
Replied On August 6, 2008 03:33 PM


Hi Jacky,

Sorry for the delay in getting back to you.

We have implemented a feature to hide a column through client side. Hiding column through server side will remove the column from visible columns collection. Hiding through client side will simply hide from showing, but actually the column will exist. Since your requirement is to use the “column2” values at the same time the “column2” should not be shown(hide), you have to hide it only through client side. Please refer the below code snippet which illustrates hiding column through client side:

$script type="text/javascript">
window.onload =hide;
function hide()
{
var gridObj = GetGridTable( document.getElementById('GridGroupingControl1') );
gridObj.HideColumn(2);
}
$/script>

Please refer the hosted sample as per your requirement, where “Col2” has been hidden:

http://websamples.syncfusion.com/samples/Grid.Web/6.3.0.30/Summary/main.htm

In the above link, the sample is running through VS2005. Could you please have a look at the above? and let us know if this helps you out.

Regards,
Raji



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.

;