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

Group Footer disappearing after group collapses

22 Answers 448 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Danielle
Top achievements
Rank 1
Danielle asked on 23 Jan 2009, 04:23 AM
Hi There,

I have set  GroupsDefaultExpanded = False and am displaying total amounts in the group footer (i.e. ShowGroupFooter="True") and have set GroupLoadMode = Client.

Upon refreshing the page/grid etc, everything looks correct - in terms of collapsed groups, correct totals, the group footer displayed etc.

When I expand the group and then decide to collapse it, I no longer see the group footer displayed and I'm not sure why. If I refresh the page again (using F5 or rebuild the grid), I can see the group footer once more.

Any assistance would be greatly appreciated.

Thanks,
Danielle

22 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 26 Jan 2009, 02:43 PM
Hi Danielle,

One possible option to enable this functionality is to set the  ShowFooter property to "true".
For more information about group footers please look at the following links:
Demo
Help topic

Additionally, if the issue persists, please send me a small runnable application, which would allow me to track the issue locally.
 
I hope this helps.

0
Danielle
Top achievements
Rank 1
answered on 29 Jan 2009, 11:50 PM
Thanks for your reply Pavlina.

I looked at the demo, and my application looks similar, however the difference is that my grid displays the "Total Products" (gridgroupfooter) when the section is collapsed. So, upon refreshing/loading up the grid, all groups are collapsed and for each group, the "Total Products" line is displayed. Then, when the group is expanded then collapsed again, the "Total Products" line is not visible (only when you expand it again, then you can see it).

I added the "ShowFooter" property and set it to "True" however this has not helped.

I'm not sure how to add attachments to posts? There doesn't appear to be an attachment button.

What I can provide for now is a copy and paste of my grid (note: columns are added programmatically).

Thanks again,
Danielle

<telerik:radgrid id="PlanRadGrid"
                                            AllowFilteringByColumn="True"
                                            AllowSorting="True"
                                            AutoGenerateColumns="False"
                                            GridLines="Both"
                                            HeaderStyle-HorizontalAlign="Center"
                                            CommandItemStyle-HorizontalAlign="Left"
                                            HorizontalAlign="Justify"
                                            OnDataBound="PlanRadGrid_DataBound"
                                            OnItemCommand="PlanRadGrid_ItemCommand"
                                            runat="server"
                                            Skin="WebBlue"
                                            OnGroupsChanging="PlanRadGrid_GroupsChanging"
                                            OnItemCreated="PlanRadGrid_ItemCreated"
                                            GroupHeaderItemStyle-HorizontalAlign="Left"
                                            ShowFooter="True"
                                            OnPreRender="PlanRadGrid_PreRender"
                                            OnItemDataBound="PlanRadGrid_ItemDataBound"
                                            OnInit="PlanRadGrid_Init"
                                            OnColumnCreating="PlanRadGrid_ColumnCreating"
                                            OnNeedDataSource="PlanRadGrid_NeedDataSource"
                                            GroupingEnabled="True" >
                            <ClientSettings AllowGroupExpandCollapse="True">
                            </ClientSettings>
                            <MasterTableView TableLayout="Fixed" 
                                            CommandItemDisplay="Top"
                                            DataKeyNames="ProjectID"
                                            GroupsDefaultExpanded="False"
                                            ShowGroupFooter="True"
                                            GroupLoadMode="Client" >
                                <CommandItemTemplate>                                        
                                        <asp:Button
                                                Runat="server"
                                                ID="ApplyFilterButton"
                                                Text="Apply Filtering"
                                                CommandName="MultiFilter" />
                                        <asp:Button
                                                Runat="server"
                                                ID="ClearAllFiltersLinkButton"
                                                Text="Clear All Filters"
                                                CommandName="ClearFilters" />
                                </CommandItemTemplate>
                                <NoRecordsTemplate>
                                    There are no projects for this plan version.
                                </NoRecordsTemplate>
                                <Columns>
                                    <telerik:GridTemplateColumn Groupable="False" AllowFiltering="False" UniqueName="CheckboxColumn" Resizable="False">
                                        <HeaderTemplate>
                                            <asp:CheckBox
                                            ID="headerChkbox" runat="server"
                                            OnCheckedChanged="ToggleSelectedState"
                                            AutoPostBack="True" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox
                                                ID="CheckBox1" runat="server"
                                                AutoPostBack="False" />
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>                          
                                </Columns>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <CommandItemStyle BackColor="Beige" VerticalAlign="Top" Font-Bold="True" Font-Size="Small" HorizontalAlign="Left" />
                            </MasterTableView>
                            <FooterStyle Font-Bold="True" Font-Size="Small" Font-Italic="True" />
                            <HeaderStyle HorizontalAlign="Center" />
                            <GroupHeaderItemStyle HorizontalAlign="Left" />
                            <CommandItemStyle HorizontalAlign="Left" />
                        <FilterMenu EnableTheming="True" Skin="WebBlue">
                            <CollapseAnimation Duration="200" Type="OutQuint" />
                        </FilterMenu>
                        </telerik:radgrid>
0
Danielle
Top achievements
Rank 1
answered on 29 Jan 2009, 11:53 PM
Hi again,

If there's a way of programmatically displaying the footer (I might be doing it incorrectly or not at all in my code), it'd be good to know.

Thanks.
0
Pavlina
Telerik team
answered on 02 Feb 2009, 09:52 AM
Hello Danielle,

I followed your scenario in order to replicate the issue but not available. Find the attached sample project , which handles the desired functionality. Let me know if this is the expected behavior or I am missing something important.

If the sample cannot help I suggest you to send me modified project so that I can see the issue locally.
To be able to add attachments to posts you should open a formal support ticket.

I hope this helps.
  
Regards,
Pavlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Danielle
Top achievements
Rank 1
answered on 04 Feb 2009, 12:44 AM
Hi Pavilna,

Thanks for the sample however, it isn't exactly what I was after... I've thought about it and have decided that I'd like the following to occur:

When the group is collapsed, the gridgroupfooter row is hidden. When the group is expanded, the gridgroupfooter row is visible.

I'd like to performm this on client-side if possible (using the GroupCollapsing and GroupExpanding methods).

Eg:

 
 
 
 
function GroupCollapsing(sender, eventArgs)  
{  
var Grid = $find("<%= RadGrid1.ClientID %>");     
var MasterTable=Grid.get_masterTableView();     
           
for(var i=0;i< MasterTable.get_dataItems().length;i++)     
{     
   -- if item type is grid group footer then  
   -- hideitem(index)  
}     
I've read somewhere that the client-side ItemType property is no longer available so how should I be determining whether the item is a gridgroupfooter item or not?

Let me know if this makes sense.

Thanks and Regards,
Danielle
0
Pavlina
Telerik team
answered on 06 Feb 2009, 05:11 PM
Hi Danielle,

The group footers are most commonly used to visualize calculations from aggregate functions within the scope of the current group.
By design when the group is collapsed, the gridgroupfooter is hidden. When the group is expanded, the gridgroupfooter is visible.
This behavior of the Grid can not be manipulate on the client-side, neither on the server-side.

Regards,
Pavlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Danielle
Top achievements
Rank 1
answered on 09 Feb 2009, 06:21 AM

Thanks for your response Pavlina.

> By design when the group is collapsed, the gridgroupfooter is hidden. When the group is expanded, the gridgroupfooter is visible.

The above is what i'd like to happen now, however it is not happening.

The group footer is still being displayed when the group is collapsed for the first time upon page load but I don't want this to occur. Is there some property or coding that is required in order to hide the groupfooter when collapsed (for the first time?)

Thanks,
Danielle

0
Pavlina
Telerik team
answered on 12 Feb 2009, 07:54 AM
Hi Danielle,

When collapsing the group for the first time the GroupFooter should not displayed.
You can see this behavior in the sample, which I sent you in the previous post.
Look at again on the following link:
Group footers

Additionally if this not helps, in order to progress in the resolution of this issue, it will be best if you send me a small project which would allow me to track the  issue locally.

Regards,
Pavlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Zach
Top achievements
Rank 1
answered on 29 May 2009, 02:01 PM

Pavlina,

Use the mastertableview code below in the sample project you attached earlier, that I modified to replicate what Danielle is referring to.

<MasterTableView ShowGroupFooter="True" TableLayout="Fixed" AllowMultiColumnSorting="True" 
                DataKeyNames="ProductID" DataSourceID="AccessDataSource1" GroupLoadMode="Client" GroupsDefaultExpanded="false">  
                <CommandItemTemplate> 
                    <asp:Button runat="server" ID="ApplyFilterButton" Text="Apply Filtering" CommandName="MultiFilter" /> 
                    <asp:Button runat="server" ID="ClearAllFiltersLinkButton" Text="Clear All Filters" 
                        CommandName="ClearFilters" /> 
                </CommandItemTemplate> 
                <NoRecordsTemplate> 
                    There are no projects for this plan version.  
                </NoRecordsTemplate> 
                <GroupByExpressions> 
                    <telerik:GridGroupByExpression> 
                        <SelectFields> 
                            <telerik:GridGroupByField FieldAlias="ProductID" FieldName="ProductID" HeaderValueSeparator=":  " /> 
                        </SelectFields> 
                        <GroupByFields> 
                            <telerik:GridGroupByField FieldName="ProductID" /> 
                        </GroupByFields> 
                    </telerik:GridGroupByExpression> 
                </GroupByExpressions> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice" 
                        SortExpression="UnitPrice" Aggregate="Sum" UniqueName="UnitPrice" FooterText="TotalPrice:">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ProductID" Aggregate="Sum" DataType="System.Int32" 
                        HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID" 
                        FooterText="TotalProduct:">  
                    </telerik:GridBoundColumn> 
                </Columns> 
                <CommandItemStyle BackColor="Beige" VerticalAlign="Top" Font-Bold="True" Font-Size="Small" 
                    HorizontalAlign="Left" />                  
            </MasterTableView> 

As you can see, I added the group by expression and I set the GroupsDefaultExpanded to false.  When you run the project, you will notice that the footer of each group is displayed.  If you expand the group and then collapse it, then the footer disappears.

This is not a consistent feature of the radgrid.  In my honest opinion it should be shown all the time because I would still like to see the summary of each group without having to see all the detail.  To get the best of both worlds, you should add another property that shows the footer when the group is collapsed.  That would solve my problem and Danielle's.

Thanks
Zach

0
Pavlina
Telerik team
answered on 01 Jun 2009, 06:30 AM
Hi Zach,

Unfortunately I could not reproduced the issue on the live site.
At this point in order to progress in the resolution of this matter it will be best if you can open a formal support ticket and send us a simple running project demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
bradley baker
Top achievements
Rank 1
answered on 14 Sep 2009, 05:59 PM
I have the same problem.  I would like to show the group footers on mutiple groupings w/out having to expand the details.  I also have the issue when you go into the details and expand back out the group footer goes away.  There is something going wrong with the codebase somewhere.  It looks like the only way to get the footer to reappear is to expand the last item in the last.  (No I dont have a live site for you to test/view)

Im going to show you what I did using your own grid example to prove my point:
http://mmo-rpg.com/1.png
http://mmo-rpg.com/2.png
http://mmo-rpg.com/3.png

This is what my page looks like:
http://mmo-rpg.com/gridgrps.png

This is what I want:
Date
    Facility
        Warehouse
Group Footer(Warehouse)
Group Footer(Facility)
Group Footer(Date)

0
Iana Tsolova
Telerik team
answered on 15 Sep 2009, 12:24 PM
Hello bradley,

I am happy to inform you that the desired feature will be available in the next version of RadGrid for ASP.NET. Then you would be able to choose to show the group footer when group is collapsed or not.

I hope this helps.
 
Best wishes,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chrysa
Top achievements
Rank 1
answered on 12 Jan 2010, 11:32 AM
Hi Iana:

Is this soon?  I too have the same issue with the grouped grids...

Thanks,
Chrysa
0
Sebastian
Telerik team
answered on 12 Jan 2010, 11:41 AM
Hello Chrysa,

The feature is already implemented and you can test it on the following online demo of the product:
http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/groupfooter/defaultcs.aspx 

The functionality has been included since the Q3 2009 version of the product. Upgrade instructions can be found here.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chrysa
Top achievements
Rank 1
answered on 12 Jan 2010, 10:51 PM
Hi Sebastian:
Got it, found it, set it, works like a charm thank you.
Chrysa
0
defne_
Top achievements
Rank 1
answered on 08 Feb 2010, 08:06 AM
Hi,
i have a similar issue with group footer. When my grid loads for first time gorup footers are fine but when a group expanded group footers' text dissapear. I load the group footer' data from server side.

 <telerik:RadGrid ShowGroupPanel="false" ID="gridResult" runat="server" AllowSorting="false" BorderWidth="0" 
OnNeedDataSource="gridResult_NeedDataSource"  OnItemDataBound="gridResult_ItemDataBound" 
GridLines="None" AutoGenerateColumns="false" Skin="Hay" 
GroupingEnabled="true">  
<ValidationSettings ValidationGroup="vgBitkiDVEA" /> 
                                  <MasterTableView ShowGroupFooter="true" ShowHeadersWhenNoRecords="false" EditMode="InPlace">  
                                     <GroupByExpressions> 
                                      <telerik:GridGroupByExpression> 
                                            <SelectFields> 
                                                <telerik:GridGroupByField FieldName="BOLGEAD" HeaderText="Bölge Adı" SortOrder="Ascending"/>  
                                            </SelectFields> 
                                            <GroupByFields> 
                                                <telerik:GridGroupByField FieldName="BOLGEAD" HeaderText="Bölge Adı" SortOrder="Ascending"/>  
                                            </GroupByFields> 
                                              
                                      </telerik:GridGroupByExpression> 
                                        
                                    </GroupByExpressions> 
                                      
                                    <Columns>      
                                    <telerik:GridTemplateColumn DataField="BOLGEAD" HeaderText="Bolge_Ad" Visible="false">  
                                            <ItemTemplate> 
                                                <asp:Label ID="lblBolgeAd" runat="server" Text='<%# Eval("BOLGEAD") %>'></asp:Label> 
                                            </ItemTemplate> 
<%--                                            <FooterTemplate> 
                                                <asp:Label ID="lblAciklama" runat="server" Text=""></asp:Label> 
                                            </FooterTemplate>--%> 
                                      </telerik:GridTemplateColumn>     
                                       <telerik:GridTemplateColumn DataField="BITKIDESENNO" HeaderText="Bitki_Deseni">  
                                            <ItemTemplate> 
                                                <asp:Label ID="lblBitkiDesenNoAd" runat="server" Text='<%# Eval("BITKIDESENAD") %>'></asp:Label> 
                                            </ItemTemplate> 
                                            <FooterTemplate> 
                                                <table  id="footerTable0" runat="server" style="width:100%" border="0" cellpadding="1" cellspacing="1"  > 
                                                    <tr> 
                                                        <td colspan="2" align="left">  
                                                            General Total:  
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            total 2:   
                                                        </td> 
                                                        <td align="left">  
                                                        <asp:Label ID="lblNetSuIhtiyaci" runat="server"></asp:Label> 
                                                        </td> 
                                                     
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            total 3:    
                                                        </td> 
                                                        <td align="left">  
                                                         <asp:Label ID="lblHektaraDusenSu" runat="server"></asp:Label> 
                                                        </td> 
                                                         
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            total 4:    
                                                        </td> 
                                                        <td align="left">  
                                                        <asp:Label ID="lblSulamaRandimani" runat="server"></asp:Label> 
                                                        </td> 
                                                    
                                                    </tr> 
                                                     <tr> 
                                                        <td align="left">  
                                                            total 5:     
                                                        </td> 
                                                        <td align="left">  
                                                        <asp:Label ID="LblBrutIhtiyac" runat="server"></asp:Label> 
                                                        </td> 
                                                        
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                        total 6:   
                                                        </td> 
                                                        <td align="left">  
                                                        <asp:Label ID="lblIhtiyacinKarsOrani" runat="server"></asp:Label>   
                                                        </td> 
                                                            
                                                    </tr> 
                                              </table> 
 
                                            </FooterTemplate> 
                                        </telerik:GridTemplateColumn> 
                                                   
                                        <telerik:GridTemplateColumn>   
                                            <HeaderTemplate> 
                                                <table style="width:100%" border="0" cellpadding="1" cellspacing="1"  > 
                                                    <tr> 
                                                        <td colspan="2" align="center">  
                                                            I.Ãœrün  
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 35%" align="center">                                                             
                                                            Ekim Alanı (ha)                                                             
                                                        </td> 
                                                        <td style="width: 30%" align="center">  
                                                            Ekim Oranı (ha)  
                                                        </td> 
                                                         <td style="width: 35%" align="center">  
                                                            u-r (mm)  
                                                        </td> 
                                                    </tr> 
                                                </table> 
                                            </HeaderTemplate> 
                                           <ItemTemplate> 
                                                <table border="0" style="width:100%"  cellpadding="1" cellspacing="1">  
                                                    <tr> 
                                                        <td style="width: 35%" align="center" > 
                                                         <asp:Label ID="lblEkimAlani1" runat="server" Text='<%# Eval("EKIMALANI1") %>'></asp:Label> 
                                                        </td>                                                     
                                                      <td style="width: 30%" align="center">  
                                                        
                                                              <asp:Label ID="lblEkilisOrani1" runat="server" Text='<%# Eval("EKILISORANI1","{0:p}")%>'></asp:Label> 
                                                   <%--  '<%# Eval("EKILISORANI1", "{0:p}")%>'></asp:Label>--%> 
                                                        </td> 
                                                        <td style="width: 35%" align="center">  
                                                          
                                                             <asp:Label ID="lblUrun1" runat="server" Text='<%# Eval("URUN1") %>'></asp:Label> 
                                                       
                                                        </td> 
                                                    </tr> 
                                                </table>                                                 
                                            </ItemTemplate> 
                                              <FooterStyle VerticalAlign="Top"/>  
                                          <FooterTemplate> 
                                            
                                            <table id="footerTable1" runat="server" border="0" style="width:100%"  cellpadding="1" cellspacing="1" > 
                                                    <tr> 
                                                        <td style="width: 35%" align="center" > 
                                                        <asp:Label ID="lblEkimAlani1Toplam" runat="server"></asp:Label> 
                                                        </td>                                                     
                                                      <td style="width: 30%" align="center">  
                                                      <asp:Label ID="lblEkilisOrani1Toplam" runat="server"></asp:Label> 
                                                               
                                                        </td> 
                                                        <td style="width: 35%" align="center">  
                                                        <asp:Label ID="lblUrun1Toplam" runat="server"></asp:Label> 
                                                               
                                                        </td> 
                                                    </tr> 
                                                  
                                                </table>         
                                           </FooterTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn> 
                                            <HeaderTemplate> 
                                                <table style="width:100%" border="0" cellpadding="1" cellspacing="1"  > 
                                                    <tr> 
                                                        <td colspan="2" align="center">  
                                                            II.Ãœrün  
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 35%" align="center">  
                                                            Ekim Alanı (ha)      
                                                        </td> 
                                                      <td style="width: 30%" align="center">  
                                                            Ekim Oranı (ha)  
                                                        </td> 
                                                        <td style="width: 35%" align="center">  
                                                            u-r (mm)  
                                                        </td> 
                                                    </tr> 
                                                </table> 
                                            </HeaderTemplate> 
                                           <ItemTemplate> 
                                                <table border="0" style="width:100%"  cellpadding="1" cellspacing="1" > 
                                                    <tr> 
                                                        <td style="width: 35%" align="center" > 
                                                           <asp:Label ID="lblEkimAlani2" runat="server" Text='<%# Eval("EKIMALANI2") %>'></asp:Label> 
                                                        </td>   
                                                        <td style="width:30%" align="center">  
                                                           <asp:Label ID="lblEkilisOrani2" runat="server" Text='<%# Eval("EKILISORANI2", "{0:p}")%>'></asp:Label> 
                                                        </td> 
                                                          <td style="width: 35%" align="center">  
                                                            <asp:Label ID="lblUrun2" runat="server" Text='<%# Eval("URUN2") %>'></asp:Label> 
                                                        </td> 
                                                    </tr> 
                                                </table>                                                 
                                            </ItemTemplate> 
                                              <FooterStyle VerticalAlign="Top"/>  
                                             <FooterTemplate> 
                                            <table  id="footerTable2" runat="server" border="0" style="width:100%"  cellpadding="1" cellspacing="1" > 
                                                    <tr> 
                                                        <td style="width: 35%" align="center" > 
                                                        <asp:Label ID="lblEkimAlani2Toplam" runat="server"></asp:Label> 
                                                              
                                                        </td>                                                     
                                                      <td style="width: 30%" align="center">  
                                                      <asp:Label ID="lblEkilisOrani2Toplam" runat="server"></asp:Label> 
                                                               
                                                        </td> 
                                                        <td style="width: 35%" align="center">  
                                                        <asp:Label ID="lblUrun2Toplam" runat="server"></asp:Label> 
                                                        </td> 
                                                    </tr> 
                                                </table>         
                                           </FooterTemplate> 
                                        </telerik:GridTemplateColumn> 
                                      </Columns> 
                                    <NoRecordsTemplate> 
                                        <div style="float: left; width: 100%; text-align: center;">  
                                            <strong> 
                                                <asp:Label ID="lblNoData" runat="server" Text="Gösterilecek her hangi bir veri bulunmadı." 
                                                    Visible="true"></asp:Label> 
                                            </strong> 
                                        </div> 
                                    </NoRecordsTemplate> 
                                     
                                </MasterTableView> 
                                  
                            </telerik:RadGrid> 

And ,
 protected void gridResult_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            try 
            {  
                if (gridResult.DataSourceIsAssigned)  
                {  
 
 
                    if (e.Item is GridDataItem)  
                    {  
                        GridDataItem dataItem = e.Item as GridDataItem;  
 //sum calculations..
                        Label lblEkimAlani1 = (Label)dataItem.FindControl("lblEkimAlani1");  
                        EkimAlani1Toplam += double.Parse(lblEkimAlani1.Text.ToString());//ekim alani 1 toplam group icin  
                        Label lblEkilisOrani1 = (Label)dataItem.FindControl("lblEkilisOrani1");  
                        EkilisOrani1Toplam += double.Parse(lblEkilisOrani1.Text.ToString().Replace("%","0"));//ekilis orani 1 toplam group icin  
                        Label lblUrun1 = (Label)dataItem.FindControl("lblUrun1");  
                        Urun1Toplam += double.Parse(lblUrun1.Text.ToString());//urun 1 toplam group icin   
                     
                       
 
                        Label lblEkimAlani2 = (Label)dataItem.FindControl("lblEkimAlani2");  
                        EkimAlani2Toplam += Convert.ToDouble(lblEkimAlani2.Text.ToString());//ekim alani 2 toplam group icin  
                         
                        Label lblEkilisOrani2 = (Label)dataItem.FindControl("lblEkilisOrani2");  
                        EkilisOrani2Toplam += double.Parse(lblEkilisOrani2.Text.ToString().Replace("%""0"));//ekilis orani 2 toplam group icin  
                        Label lblUrun2 = (Label)dataItem.FindControl("lblUrun2");  
                        Urun2Toplam += double.Parse(lblUrun2.Text.ToString());//urun 2 toplam group icin  
 
                    }  
                      
                    if (e.Item is GridGroupHeaderItem)  
                    {  
                        GridGroupHeaderItem header = (GridGroupHeaderItem)e.Item;  
                        header.Expanded = false;  
                          
                          
                    }  
                    if (e.Item is GridGroupFooterItem)  
                    {  
 
                        GridGroupFooterItem footer = (GridGroupFooterItem)e.Item;  
 
                        Table table=new Table();//fist column footer table  
                        table.Width = new Unit(100.0, UnitType.Percentage);  
                        table.Rows.Add(new TableRow());  
                        table.Rows[0].Cells.Add(new TableCell());  
                        table.Rows[0].Cells.Add(new TableCell());  
                        table.Rows[0].Cells.Add(new TableCell());  
                        table.Rows[0].Cells[0].Width = new Unit(35.0, UnitType.Percentage);  
                        table.Rows[0].Cells[1].Width = new Unit(30.0, UnitType.Percentage);  
                        table.Rows[0].Cells[2].Width = new Unit(35.0, UnitType.Percentage);  
                        table.Rows[0].Cells[0].Text = Math.Truncate(EkimAlani1Toplam).ToString();  
                        table.Rows[0].Cells[1].Text = Math.Truncate(EkilisOrani1Toplam).ToString();  
                        table.Rows[0].Cells[2].Text = Math.Truncate(Urun1Toplam).ToString();  
 
                        Table table2 = new Table();//2nd column footer table  
                        table2.Rows.Add(new TableRow());  
                        table2.Rows[0].Cells.Add(new TableCell());  
                        table2.Rows[0].Cells.Add(new TableCell());  
                        table2.Rows[0].Cells.Add(new TableCell());  
                        table2.Width = new Unit(100.0, UnitType.Percentage);  
                        table2.Rows[0].Cells[0].Width = new Unit(35.0, UnitType.Percentage);  
                        table2.Rows[0].Cells[1].Width = new Unit(30.0, UnitType.Percentage);  
                        table2.Rows[0].Cells[2].Width = new Unit(35.0, UnitType.Percentage);  
 
                        table2.Rows[0].Cells[0].Text =Math.Truncate(EkimAlani2Toplam).ToString();  
                        table2.Rows[0].Cells[1].Text = Math.Truncate(EkilisOrani2Toplam).ToString();  
                        table2.Rows[0].Cells[2].Text = Math.Truncate(Urun2Toplam).ToString();  
 
                        footer.Cells[4].Text = "Toplam: ";  
                        footer.Cells[5].Controls.Add(table);  
                        footer.Cells[6].Controls.Add(table2);  
             
 
                        //calculation variables reset  
                        EkimAlani1Toplam = 0;  
                        Urun1Toplam = 0;  
                        EkilisOrani1Toplam = 0;  
 
                        EkimAlani2Toplam = 0;  
                        Urun2Toplam = 0;  
                        EkilisOrani2Toplam = 0;  
 
                    }  
 
                    if (e.Item is GridFooterItem)  
                    {  
                        DataTable footerTable = new DataTable();  
                        footerTable = Sulama.Business.BitkiDVEABusiness.getFooter();  
                        gridResult.ShowFooter = true;  
                        GridFooterItem footer = (GridFooterItem)e.Item;  
                        Label lblEkimAlani1Toplam = (Label)footer.FindControl("lblEkimAlani1Toplam");  
                        lblEkimAlani1Toplam.Text = footerTable.Rows[0]["EKIMALANI1"].ToString();  
 
                        Label lblEkilisOrani1Toplam = (Label)footer.FindControl("lblEkilisOrani1Toplam");  
                        lblEkilisOrani1Toplam.Text = footerTable.Rows[0]["EKILISORANI1"].ToString();  
                        Label lblUrun1Toplam = (Label)footer.FindControl("lblUrun1Toplam");  
                        lblUrun1Toplam.Text = footerTable.Rows[0]["URUN1"].ToString();  
                        Label lblEkimAlani2Toplam = (Label)footer.FindControl("lblEkimAlani2Toplam");  
                        lblEkimAlani2Toplam.Text = footerTable.Rows[0]["EKIMALANI2"].ToString();  
 
                        Label lblEkilisOrani2Toplam = (Label)footer.FindControl("lblEkilisOrani2Toplam");  
                        lblEkilisOrani2Toplam.Text = footerTable.Rows[0]["EKILISORANI2"].ToString();  
                        Label lblUrun2Toplam = (Label)footer.FindControl("lblUrun2Toplam");  
                        lblUrun2Toplam.Text = footerTable.Rows[0]["URUN2"].ToString();  
 
                        Label lblNetSuIhtiyaci = (Label)footer.FindControl("lblNetSuIhtiyaci");  
                        lblNetSuIhtiyaci.Text = footerTable.Rows[0]["NETSUIHTIYACI"].ToString();  
                        Label lblHektaraDusenSu = (Label)footer.FindControl("lblHektaraDusenSu");  
                        lblHektaraDusenSu.Text = footerTable.Rows[0]["HEKTARADUSENSU"].ToString();  
                        Label lblSulamaRandimani = (Label)footer.FindControl("lblSulamaRandimani");  
                        lblSulamaRandimani.Text = footerTable.Rows[0]["SULAMARANDIMANI"].ToString();  
                        Label lblBrutIhtiyac = (Label)footer.FindControl("lblBrutIhtiyac");  
                        lblBrutIhtiyac.Text = footerTable.Rows[0]["BRUTIHTIYAC"].ToString();  
                        Label lblIhtiyacinKarsOrani = (Label)footer.FindControl("lblIhtiyacinKarsOrani");  
                        lblIhtiyacinKarsOrani.Text = footerTable.Rows[0]["IHTIYACINKARSILANMAORANI"].ToString();  
 
                    }  
                   
                }  
            }  
            catch (Exception ex)  
            {  
                LogManager.Current.CreateLog("Bitki Deseni ve Ekim Alanı Turkiye", ex);  
            }  
 
        } 

Thanks,
Defne
0
John
Top achievements
Rank 1
answered on 12 Oct 2011, 06:58 PM
I had this same problem, but found a good solution to combat the issue.
In-case its not clear, this issue I am referring to...

I have a RadGrid with multiple nested groups. 
Upon the first loading of the page, all footers for all groups are displayed, even with these settings set:

this.Grid.MasterTableView.ShowGroupFooter = true;
this.Grid.MasterTableView.GroupsDefaultExpanded = false;

this.Grid.GroupingSettings.RetainGroupFootersVisibility = true;


Expanding the top level group, then immediately collapsing it causes all footers of child groups to disappear, leaving only the footer of the top level parent.

The problem appears to lie with how the RadGrid deals with the footer's style, which is different then the headers for the groups, i.e. there is a rgGroupHeader style but no rgGroupFooter style.

My solution is to apply a style to each child footer as the items are created. 

   #region Properties
   private int GroupingCount = 0;
   #endregion Properties
 
void Grid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridGroupHeaderItem)
    {
        ++GroupingCount;
    }
    if (e.Item is GridGroupFooterItem)
    {
        --GroupingCount;
        if (GroupingCount > 0)
        {
            e.Item.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
    }
}

This ensures that upon rendering, each footer not belonging to the top level group will be properly hidden.
Hope this helps!
John M Davis Jr.

0
Pavlina
Telerik team
answered on 17 Oct 2011, 03:08 PM
Hi John,

Thank you for sharing your experience with the community. However, I will appreciate if  you can send us a sample working project which demonstrates this erroneous behaviour, so that we can test it locally and see what is causing it.

Best wishes,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Aghogho
Top achievements
Rank 1
answered on 18 Jul 2014, 08:19 AM
Hi Danielle,

I'm just wandering, is it possible to display the summary rows of each grouping under collapsed mode ?. Summary rows display actually under each grouping but hides automatically when collapsed. What i want is to display the summary rows under each collapse.

However, while researching i stumbled on this link : http://www.telerik.com/help/aspnet-ajax/grid-group-footers.html, but apparently its for asp and not winforms. 

Finally, what i am asking for is the combination of setting the autoexpandgroups to false, and also displaying the summaryrow also 
0
Eyup
Telerik team
answered on 23 Jul 2014, 07:46 AM
Hi Aghogho,

You can try enabling the following property:
<GroupingSettings ... RetainGroupFootersVisibility="true" />

Hope this helps.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Aghogho
Top achievements
Rank 1
answered on 23 Jul 2014, 08:28 AM
Hi the ks for the reply but I meant for c# -winforms
0
Eyup
Telerik team
answered on 24 Jul 2014, 07:09 AM
Hi Aghogho,

In that case I suggest that you open a new formal support ticket or a new forum thread choosing the corresponding Product line from the ticket options since this thread concerns RadGrid for ASP.NET AJAX.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Danielle
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Danielle
Top achievements
Rank 1
Zach
Top achievements
Rank 1
bradley baker
Top achievements
Rank 1
Iana Tsolova
Telerik team
Chrysa
Top achievements
Rank 1
Sebastian
Telerik team
defne_
Top achievements
Rank 1
John
Top achievements
Rank 1
Aghogho
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or