This is a migrated thread and some comments may be shown as answers.

[Solved] Two Possible Bugs in Grouping?

9 Answers 327 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 02 Sep 2008, 03:36 PM
Hi,

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

Sort by
0
Michael
Top achievements
Rank 1
answered on 02 Sep 2008, 05:03 PM
Hi,

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.

  1. Open the sample apps project to the Grid\Examples\GroupBy\Expressions\DefaultCS.aspx
  2. Set AutoGenerateColumns to false
  3. 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)
  4. Set ShowGroupFooter to true in the MasterTableView element.
  5. Run the app and navigate to that page.
  6. 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:###,###}" />

0
Nikolay Rusev
Telerik team
answered on 03 Sep 2008, 02:38 PM
Hello Michael,

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.
0
Mark
Top achievements
Rank 1
answered on 17 Sep 2008, 08:26 AM
I have this behaviour.  Is there a reference I can track to find when a solution will be available?

Regards,
Mark
0
Nikolay Rusev
Telerik team
answered on 23 Sep 2008, 08:07 AM
Hello 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.
0
Trygve
Top achievements
Rank 1
answered on 18 May 2009, 07:49 AM
Have these two errors been corrected?
If not, do you know when I can expect the fix?

Are there any workarounds that I can do until it's fixed?
0
Bruno
Top achievements
Rank 2
answered on 19 May 2009, 10:26 AM
Did you try latest internal build? I have similar issue with footer grouping calculations but they seems to be fixed with the latest build.

--Bruno
0
Zach
Top achievements
Rank 1
answered on 19 May 2009, 04:34 PM

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

0
Le
Top achievements
Rank 1
answered on 21 May 2009, 02:01 AM
Hello,
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 != "&nbsp;")
             {
                        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 != "&nbsp;")
                            {
                   
                                        cell.Text = strGroupHeader;
                                        break;
                             }
                           
                        }
                 }
            }//and for
} //end if
Try with that and any suggest.
Best regards,
Le

0
Zach
Top achievements
Rank 1
answered on 28 May 2009, 01:56 PM

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

Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Mark
Top achievements
Rank 1
Trygve
Top achievements
Rank 1
Bruno
Top achievements
Rank 2
Zach
Top achievements
Rank 1
Le
Top achievements
Rank 1
Share this question
or