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

[Solved] can i bind datatable to mvc grid with Aggregate columns ?

0 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Meir
Top achievements
Rank 1
Meir asked on 30 Dec 2012, 05:06 PM
בס"ד

Hi ,

I have bind datatable to telerik mvc grid ,and it's work fine!

but when i tried to Aggregate my amount columns nothing happens.

here is the code : 
@(
Html.Telerik().Grid(Model.MvGridDt)
            .Name("Grid")
            .Columns(columns =>
            {
               foreach (System.Data.DataColumn column in Model.MvGridDt.Columns)
                {
                    if (column.ColumnName == "Total")
                      columns.Bound(column.DataType, column.ColumnName)
                        .Aggregate(aggregates => aggregates.Sum())
                        .ClientFooterTemplate("Total Sum: <#= Sum #>")
                         .ClientGroupFooterTemplate("Sub Total Sum: <#= Sum #>");
                    else
                        columns.Bound(column.DataType, column.ColumnName);
                }
            })
            .DataBinding(dataBinding => dataBinding.Ajax()
                    .Select("GetGridData", "AFReport")
             )
           .Pageable()
        .Sortable()
        .Scrollable()
        .Groupable()
)

there is way to aggregates this way  ? 

Regards,
Moshe Yariv Malka



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