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

merge columns header in BoundColumns

2 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gino Suarez
Top achievements
Rank 1
Gino Suarez asked on 02 Dec 2009, 03:06 PM
HI, How could i implement merge columns header using telerik:gridboundcolumns 'cause i need the agreggate function of this kind of columns.

Regards
Gino

2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 02 Dec 2009, 09:15 PM
Are you looking to have an aggregate function for all of the BoundColumns? I believe this documentation article can have some information on how to properly assign various footer setups.
0
Shinu
Top achievements
Rank 1
answered on 04 Dec 2009, 11:07 AM
Hi Gino,

You can try the following code in order to merge the column header of GridBoundColumns.

CS:
 
 <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID" 
        UniqueName="CustomerID"
        <HeaderStyle HorizontalAlign="Center" /> 
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" 
        UniqueName="CompanyName"
    </telerik:GridBoundColumn> 

CS:
 
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridHeaderItem) 
        { 
            GridHeaderItem headerItem = (GridHeaderItem)e.Item; 
            headerItem["CustomerID"].ColumnSpan = 2; 
            headerItem["CompanyName"].Visible = false
        } 
    } 

-Shinu.
Tags
Grid
Asked by
Gino Suarez
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Shinu
Top achievements
Rank 1
Share this question
or