Change of Format getting issue
Unable to cast object of type 'Syncfusion.Grouping.BooleanAggregateSummary' to type 'Syncfusion.Grouping.CountSummary'.
Shall you give clarification on this exception
Shall you give clarification on this exception
SIGN IN To post a reply.
7 Replies
SR
Sri Rajan
Syncfusion Team
July 10, 2008 11:32 AM UTC
Hi Manjesh,
Thank you for your interest in Syncfusion products.
It is hard to trace out the problem without a working sample which reproduces this issue. Is it possible for you to upload a minimal sample which reproduces this issue?. That will help us to analyze this issue further.
Best Regards,
Srirajan.
Thank you for your interest in Syncfusion products.
It is hard to trace out the problem without a working sample which reproduces this issue. Is it possible for you to upload a minimal sample which reproduces this issue?. That will help us to analyze this issue further.
Best Regards,
Srirajan.
AD
Administrator
Syncfusion Team
July 11, 2008 02:08 PM UTC
Hi,
I am very thankful to you for your quick response to my issue.
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 through an exception.
Please confirm, is it a missed functionality with syncfusion 4.4?
cast_Exception_2fcb0ac9.zip
I am very thankful to you for your quick response to my issue.
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 through an exception.
Please confirm, is it a missed functionality with syncfusion 4.4?
cast_Exception_2fcb0ac9.zip
SR
Sri Rajan
Syncfusion Team
July 14, 2008 09:13 AM UTC
Hi Manjesh,
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.
Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F75049/main.htm
Please let me know if this helps.
Best Regards,
Srirajan.
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/F75049/main.htm
Please let me know if this helps.
Best Regards,
Srirajan.
AD
Administrator
Syncfusion Team
July 14, 2008 02:05 PM 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.
>Hi Manjesh,
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.
Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/F75049/main.htm
Please let me know if this helps.
Best Regards,
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.
>Hi Manjesh,
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/F75049/main.htm
Please let me know if this helps.
Best Regards,
Srirajan.
SR
Sri Rajan
Syncfusion Team
July 15, 2008 10:40 AM UTC
Hi Manjesh,
Thank you for your interest in syncfusion products.
Here is the code to change the summary type.
Please let me know if this helps.
Best Regards,
Srirajan.
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.
AD
Administrator
Syncfusion Team
July 15, 2008 01:27 PM UTC
Hi SreeRajan,
Thanks a lot.Please check ur code and pleae let me know why this is not working in the case of button click
GGC_MasterDetail_Summary_1c5a96e3.zip
Thanks a lot.Please check ur code and pleae let me know why this is not working in the case of button click
GGC_MasterDetail_Summary_1c5a96e3.zip
SR
Sri Rajan
Syncfusion Team
July 16, 2008 07:29 AM UTC
Hi Manjesh,
Thank your continued interest in Syncfusion products.
It is not possible to convert SummaryType from SummaryType.Count to SummaryType.BooleanAggregate. You can change the summary column type using following technique. Please refer the below code for more details.
Please let me know if this helps.
Best Regards,
Srirajan.
Thank your continued interest in Syncfusion products.
It is not possible to convert SummaryType from SummaryType.Count to SummaryType.BooleanAggregate. You can change the summary column type using following technique. Please refer the below code for more details.
private void button1_Click(object sender, EventArgs e)
{
GridSummaryColumnDescriptor sd = this.gridGroupingControl1.GetTableDescriptor("ChildTable").SummaryRows[0].SummaryColumns[0];
sd.SummaryType = SummaryType.Int32Aggregate;
this.gridGroupingControl1.GetTableDescriptor("ChildTable").SummaryRows[0].SummaryColumns.RemoveAt(0);
this.gridGroupingControl1.GetTableDescriptor("ChildTable").SummaryRows[0].SummaryColumns.Add(sd);
this.gridGroupingControl1.GetTableDescriptor("ChildTable").SummaryRows[0].ResetDisplayColumns();
this.gridGroupingControl1.Refresh();
}
Please let me know if this helps.
Best Regards,
Srirajan.
SIGN IN To post a reply.
- 7 Replies
- 2 Participants
-
AD Administrator
- Jul 10, 2008 09:38 AM UTC
- Jul 16, 2008 07:29 AM UTC