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

Calculate total at footer

3 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saran kumar
Top achievements
Rank 1
Saran kumar asked on 18 Jan 2010, 07:39 AM
hi please find attached the radgrid image, where in all the columns are grid bound columns, i just wanna calculate the total of the values at footer.

pleases help.
<Columns> 
                        <telerik:GridBoundColumn UniqueName="Month" HeaderText="Month" DataField="Lead_Month" 
                            HeaderStyle-Width="200px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="Leads" HeaderText="Leads" DataField="Intake" 
                            HeaderStyle-Width="150px">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="Clients" HeaderText="Clients" DataField="Client" 
                            HeaderStyle-Width="150px">  
                        </telerik:GridBoundColumn> 
                        
                    </Columns> 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Jan 2010, 07:53 AM
Hi Saran Kumar,

The GridBoundColumn object has an Aggregate property that you can set to specify a function for aggregating the values that the column displays. Set Aggregate property to "Sum".

ASPX:
 
<telerik:GridBoundColumn DataField="Leads" DataType="System.Int32" HeaderText="Leads" 
    SortExpression="Leads" UniqueName="Leads"  Aggregate="Sum"
</telerik:GridBoundColumn> 
Also set the ShowFooter property of grid to True.

Checkout the documentation for more information: Column Aggregates

Thanks,
Princy.
0
Saran kumar
Top achievements
Rank 1
answered on 19 Jan 2010, 05:04 AM
Hi thanks for your reply, i have tried it with using the datatype = "system.int32" its thowing an exception "Specified cast is not valid.".
then i used system.string its too throwing a exceptions "system.object does not support".

please help.
0
Princy
Top achievements
Rank 2
answered on 19 Jan 2010, 08:02 AM
Hello Saran,

It seems your column is of string datatype. Thus, you could manually calculate the sum for the column from code-behind. You can refer to the section 'Programmatic solution' under the following document to understand how to manually get the totals for a column in its footer:
Totals in grid footers

Thanks
Princy.
Tags
Grid
Asked by
Saran kumar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Saran kumar
Top achievements
Rank 1
Share this question
or