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

How to create group footer

4 Answers 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
TovaT
Top achievements
Rank 1
TovaT asked on 12 Dec 2010, 10:33 AM
Hi,
I created a rad grid with GroupByExperssion.
I want to add a footer for each group. (like the header but below - with the group field and other additional fields)
Is there any way to do this?

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 14 Dec 2010, 04:58 PM
Hi t,

In order to show the group footers in RadGrid, try setting the ShowGroupFooter property of the MasterTableView. The you can try handling the ItemCreated/ItemDataBound event of the grid and there add the desired information.

All the best,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
TovaT
Top achievements
Rank 1
answered on 15 Dec 2010, 09:41 AM
Thank you very much. it works perfect.
and I have another question - how can I hide the Expand column? I searched this article in the forums and tried all the solutions but nothing works.
I tried use the events of "RadGrid1_PreRender", "RadGrid1_ColumnCreated"  to make the column visible=false. I tried to get the column by unique name and by "TableView.ExpandCollapseColumn" and by the tableView.Columns(0) . I tried "Display" and "Visible" properties of the column.
I tried to change the css class - rgExpandCol
I tried to change the attributes in the aspx page in master table view - ExpandCollapseColumn-Dispaly="true" and change the css by ExpandCollapseColumn-itemStyle-cssClass.
but nothing happens. The expand column appears all the time. Only if I delete the GroupByExpression it disappears.

(I don't have hierarchy in the grid, there is only one table and I want to group the rows by two fields)
0
Iana Tsolova
Telerik team
answered on 15 Dec 2010, 02:32 PM
Hi,

Hinding the grid group expand column is a bit hard task. However you can handle the ColumnCreated and ItemCreated events as below and see if it works for you:

void grid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
    if (e.Column.ColumnType == "GridGroupSplitterColumn")
    {
        e.Column.Visible = false;
    }
}
void grid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridGroupHeaderItem)
    {
        (e.Item as GridGroupHeaderItem).Controls[0].Visible = false;
    }
}


Greetings,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
TovaT
Top achievements
Rank 1
answered on 16 Dec 2010, 01:38 PM
I don't believe, it works! Thank you very very much!!!!!!!
You don't know how much you helped me. I worked on it 2 days...
Tags
General Discussions
Asked by
TovaT
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
TovaT
Top achievements
Rank 1
Share this question
or