Display single column from datasource in header/footer

2 posts, 0 answers
  1. Kurt Kluth
    Kurt Kluth avatar
    171 posts
    Member since:
    Oct 2009

    Posted 20 Jun 2017 Link to this post

    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>

     

  2. Eyup
    Admin
    Eyup avatar
    4074 posts

    Posted 23 Jun 2017 Link to this post

    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.
Back to Top