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

Heirarchical table format change issue

Thread ID:

Created:

Updated:

Platform:

Replies:

75103 Jul 14,2008 04:28 AM UTC Jul 15,2008 10:45 AM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 14, 2008 04:28 AM UTC

I have a two level heirarchical table which includes two tables(eg Table A and B(child)),

There I take any field(column) of table A and added summarycolumn for that.After that if i change the format of this parent table it works fine.

But in the case of inner table B,when i proceed with the same senario that i have done with parent table A,it fails to produce an output and throws an exception("Unable to cast object of type 'Syncfusion.Grouping.BooleanAggregateSummary' to type 'Syncfusion.Grouping.CountSummary'.
).

Please confirm, is it a missed functionality with syncfusion 4.4.0.51?



Sri Rajan [Syncfusion]
Replied On July 14, 2008 09:17 AM UTC

Hi Nidhin,

Thank you for your continued interest in Syncfusion products.

Please refer the below code which shows you how to change Summary Column format of Parent and Child Tables.

DataTable parentTable = ParentTable();
DataTable childTable = ChildTable();
DataSet dSet = new DataSet();
dSet.Tables.AddRange(new DataTable[] { parentTable, childTable});
DataColumn parentColumn = parentTable.Columns["PID"];
DataColumn childColumn = childTable.Columns["PID"];
dSet.Relations.Add("ParentToChild", parentColumn, childColumn);
this.gridGroupingControl1.DataSource = parentTable;
this.gridGroupingControl1.Engine.BindToCurrencyManager = false; // don't attach this one to CurrencyManager.

GridSummaryColumnDescriptor scd1 = new GridSummaryColumnDescriptor("Sum", SummaryType.Int32Aggregate, "ParentValue", "{Sum:#}");
GridSummaryRowDescriptor srd1 = new GridSummaryRowDescriptor("Sum", "Total", scd1);
srd1.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right;
srd1.Appearance.AnyCell.BackColor = SystemColors.Info;

GridSummaryColumnDescriptor scd2 = new GridSummaryColumnDescriptor("Sum", SummaryType.Int32Aggregate, "ChildValue", "{Sum:#}");
GridSummaryRowDescriptor srd2 = new GridSummaryRowDescriptor("Sum", "Total", scd2);
srd2.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right;
srd2.Appearance.AnyCell.BackColor = SystemColors.Info;

this.gridGroupingControl1.GetTableDescriptor("ParentTable").SummaryRows.Add(srd1); this.gridGroupingControl1.GetTableDescriptor("ChildTable").SummaryRows.Add(srd2);

//Change the format here.
scd1.Format = "{Sum:##.0000}";
scd2.Format = "{Sum:##.00}";


Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F75103/main.htm

Please let me know if this helps.

Best Regards,
Srirajan.


Administrator [Syncfusion]
Replied On July 15, 2008 04:35 AM UTC

Hi Srirajan,

Thankyou very much for the quick response.

I just went through the sample program for setting the summary rows. For m case the application works fine while adding the summary rows; but i get an invalid cast exception while changing the summary type of an already existing summary column descriptor. I'm pasting the psuedo code below,

GridSummaryColumnDescriptor sd = this.m_tableDescriptor.SummaryRows[0].SummaryColumns["OrderID"]

sd.SummaryType = SummaryType.BooleanAggregate;


Please let me know how to edit the summary type of an existing summary column descriptor.

Thanks in advance


Sri Rajan [Syncfusion]
Replied On July 15, 2008 10:45 AM UTC

Hi Nidhin,

Thank you for your interest in syncfusion products.

Here is the code to change the summary type.

GridSummaryColumnDescriptor sd = this.gridGroupingControl1.GetTableDescriptor("ParentTable").SummaryRows[0].SummaryColumns[0];
sd.SummaryType = SummaryType.DoubleAggregate;


Please let me know if this helps.

Best Regards,
Srirajan.



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

;