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

Group Footer questions

1 Answer 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 14 May 2008, 09:22 PM
I like the new group footer feature but my user would like to see the sub-totals near the group info. When we have lots of data, the group header and the group footer are not viewable together on the page so it is tough to know what the sub-total info pertains too.

Here are my questions:
- Is there a way to keep the group footer displayed when the group header is collapsed?
- Is there a way to have the group footer moved up under the corresponding group header (i know it would no longer truely be a footer at that point).
- I know the group header can contain group totals but can it be done so that the totals are in line with the column they pertain to?

Thanks.

Tim


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 May 2008, 06:04 AM
Hi Tim,

While the group footer cannot retain its visibility if you collapse the group, nor can its position be easily altered, you can add the calculations to the group header instedad. The alignment may be handled by using code like the following:

.cs
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridGroupHeaderItem)  
        {  
            (e.Item as GridGroupHeaderItem).DataCell.Visible = false;  
            e.Item.PreRender += new EventHandler(Item_PreRender);  
        }  
    }  
 
    void Item_PreRender(object sender, EventArgs e)  
    {  
        string text = ((GridGroupHeaderItem)sender).DataCell.Text;  
        for (int i = 3; i < ((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns.Length; i++)  
        {  
            TableCell cell = new TableCell();  
            if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "UnitPrice")  
            {  
                cell.Text = text;  
            }  
            ((GridGroupHeaderItem)sender).Cells.Add(cell);  
        }  
    } 

I hope this information helps.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or