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

Sum of column in fotter depend on some condition

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 12 Dec 2013, 07:56 AM
Hi


I need to sum on column in footer of grid. But it depends on condition

suppose i want A colum sum in fotter, Depnd on B column value if B column row value is null then no need consider that row 

    Column A  Colum B
            12                  30
            22                  
            44                   40
Sum :   56

only consider first and last row.
in sendon row b column is null

please help

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Dec 2013, 08:14 AM
Hi Rahul,

You can use Custom column aggregate:
http://www.telerik.com/help/aspnet-ajax/grid-column-aggregates.html

Or you can define a GridCalculatedColumn:
<telerik:GridCalculatedColumn UniqueName="CalculatedColumnName" HeaderText="Calculated"
    DataFields="OrderID,Freight" Expression="{0}+{1}" Aggregate="Sum" DataType="System.Decimal">
</telerik:GridCalculatedColumn>

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or