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

Display single column from datasource in header/footer

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 20 Jun 2017, 08:35 PM

A field within the returned DataSource needs to either be displayed in the header or the footer and I am unsure of how to do this.  A column name is Cycle_Date and I would like to display something similar to this "Data as of <% =cycle_date%>".  I don't need to display it as a bound column within the grid just in either the header or footer.

 

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlExcessAnalysis" AutoGenerateColumns="false" EnableEmbeddedSkins="true"
    ShowFooter="true" FooterStyle-BackColor="#443634" GridLines="None" FooterStyle-ForeColor="White" AlternatingItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
    <MasterTableView CommandItemDisplay="Top">
        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
        <ColumnGroups>
            <telerik:GridColumnGroup Name="ExcessInformation" HeaderText="Excess Market Analysis" HeaderStyle-HorizontalAlign="Center" />
        </ColumnGroups>
        <Columns>
            <telerik:GridBoundColumn DataField="state" HeaderText="State" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center" ColumnGroupName="ExcessInformation"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TotalExcess" HeaderText="# of Insureds" Aggregate="Sum" FooterAggregateFormatString="{0}" ColumnGroupName="ExcessInformation">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TotalQualified" HeaderText="Total Qualified" Aggregate="Sum" FooterAggregateFormatString="{0}" ColumnGroupName="ExcessInformation">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Jun 2017, 10:18 AM
Hi Kurt,

You are already aware of multi-column headers:
http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/multi-column-headers/defaultcs.aspx

Another option is Grouping:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/grouping/group-footers/defaultcs.aspx

There is also the CommandItemTemplate:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/commanditem/defaultcs.aspx

And finally the grid provides the following property:
<MasterTableView ... Caption="Some Data">

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or