I'm having 2 problems with a grid with 2 level grouping and aggregates.
1) The sum of the outer group is not calculating correctly (see screenshot on link), it should be displaying 1575000, but is displaying 562500, This seems to be the sum of each last item in each sub group. I have been playing around with the demo app and it seems to be working correctly coming form the northwind data set, but when I change the demo app to my data set, usign minimal fields and settings what worked on northwind does not calculate properly on my data set. Do you have any thoughts on why this might be happening?
Screenshot
2) The group total for the outer group is being lost when I collapse the last sub group in the list. This behavior also appears in the GroupBy sample app when group footers are enabled. I would have expected them to stay visible even when all the sub groups are collapsed?
Thanks
Mike
9 Answers, 1 is accepted
I've been looking into problem 1 this afternoon.
It seems I was wrong in saying that the demo app is working correctly with the northwind data.. it is also incorrect.
The steps to produce this error are as follows.
- Open the sample apps project to the Grid\Examples\GroupBy\Expressions\DefaultCS.aspx
- Set AutoGenerateColumns to false
- Add the following columns (they are the same as autogenerated ones but with an aggregate set on two of the columns. (see bottom of post for column def's)
- Set ShowGroupFooter to true in the MasterTableView element.
- Run the app and navigate to that page.
- Add the following 2 expressions one by one a) "country group by country" b) "city group by city"
Now you should have 2 levels of grouping and if you look a the sub total listed next to Argentina (8,119.10) and then compare that to the value stated in the group footer for Argentina (3,460), you can see that the group footer has simply taken the value from OCEAN and put that as the total. You can see further examples all the way down, for example Brazil should be 114,954 but is listed as 53,413.
I hope this helps in tracking down the problem...
Thanks again
Mike
New column defs
<
telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="CustomerID" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="Country" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="City" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="CompanyName" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="ContactName" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="TotalOrders" Aggregate="Sum" />
<telerik:GridBoundColumn HeaderButtonType="TextButton" DataField="TotalAmount" Aggregate="Sum" FooterAggregateFormatString="{0:###,###}" />
Unfortunately you are right in your observations as this is known issue.
Our developers are aware of this and hopefully the problem will be resolved as soon as possible.
Regards,
NikR
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Regards,
Mark
You can keep track on what is fixed, changed or added to RadControls for ASP.NET AJAX visiting the following link:
Release History
Best,
NikR
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
If not, do you know when I can expect the fix?
Are there any workarounds that I can do until it's fixed?
--Bruno
I downloaded the latest hotfix and it still does not work. I even applied it to the demo app and followed what Michael did and it still does not work there either. If you follow what he points out, yes Argentina looks fine, but if you look down at Brazil, it's just showing the sum of the last group, "Sao Paulo", under Brazil. I'm experiencing the exact same problem with my app.
The latest hot fix, which includes build 2009.1.414 that had the fix for this problem, cleared it up some, but it's still not there.
Do I need to send in a support ticket?
Zach
I got the lasted version but I still get the same issue.
And my suggest : At frist you try to get each of Group Header value, after that reset the text of each Group Footer Item.
Follow the code snippet:
- In ItemDataBound Event
//Get Group Header Value
if(e.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem header = (GridGroupHeaderItem)e.Item;
string strGroupHeader;
for(int i = 0;i< header.Controls.Count;i++)
{
if (((Telerik.Web.UI.GridTableCell)(header.Controls[i])).Text != " ")
{
strGroupHeader = ((Telerik.Web.UI.GridTableCell)(header.Controls[i])).Text;
//and save GroupIndex
}
}
//Retrieve the Group Footer by 'GroupIndex' and set value of each Group Footer item.
if (e.Item is GridGroupFooterItem)
{
GridGroupFooterItem footer = (GridGroupFooterItem)e.Item;
for (int i = 0; i < lstGroupIndex.Count; i++)
{
if (lstGroupIndex[i].Equals(footer.GroupIndex))
{
foreach (TableCell cell in footer.Cells)
{
if (cell.Text != " ")
{
cell.Text = strGroupHeader;
break;
}
}
}
}//and for
} //end if
Try with that and any suggest.
Best regards,
Le
Le,
Your suggestion worked. However, after spending a few hours getting it to work, I just got notice from Telerik they fixed this and the fix is in their 2009 Q1 SP2 release. I downloaded the release and it seems to work.
Thanks again for your help!
Zach