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

Get aggregate value from footer (client side)

0 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 20 Dec 2017, 12:25 PM

I have a grid made up of bound columns.

Some of the columns have an aggregate (Sum) to show totals in the footer.

How can I access these values client side, using the column name if possible?

Can I make use of 'get_masterTableViewFooter()' ?

 

Example basic grid:

<telerik:RadGrid ID="itemsGrid" >
    <MasterTableView ShowFooter="True" Width="100%"
                     DataKeyNames="ID" ClientDataKeyNames="ID">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" UniqueName="id" HeaderText="ID" />
            <telerik:GridBoundColumn DataField="quantity" HeaderText="Qty" UniqueName="quantity" />
            <telerik:GridBoundColumn DataField="price" HeaderText="Price" UniqueName="price" Aggregate="Sum" />
            <telerik:GridBoundColumn DataField="total" HeaderText="Total" UniqueName="total" Aggregate="Sum" />
        </Columns>
        <FooterStyle />
    </MasterTableView>
</telerik:RadGrid>

 

Javascript:

function CheckTotals(sender, eventArgs) {
    // get totals from footer
    var grid = $find('<%=itemsGrid.ClientID%>');
    var masterTableViewFooter = grid.get_masterTableViewFooter();
     
    // how to access 'Price' aggregate from footer??
}

 

Thanks

Jason

 

 

 

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Share this question
or