Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:19:27+00:00 2026-06-18T04:19:27+00:00

Specs Kendo: 2012.3.1114 .Net: 4.5 MVC: 4.0 Problem I am binding my grid using

  • 0

Specs

Kendo: 2012.3.1114

.Net: 4.5

MVC: 4.0

Problem

I am binding my grid using a DataTable as the Model and I need to have aggregate values.
If I use the snippet below as my base (taken from the Kendo UI Code Library) there seems to be no way to set up the aggregate functions.

@(Html.Kendo().Grid(Model)
    .Name("Grid")    
    .Columns(columns => {
        foreach (System.Data.DataColumn column in Model.Columns)
        {
            columns.Bound(column.DataType, column.ColumnName);
        }
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .Groupable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Read", "Home"))   
    )
)

Back in the days of the Telerik MVC controls I could set up the aggregate function you could setup the aggregate while adding the bound column but in the Kendo UI wrapper that has been moved down to be inside of the DataSource.

Telerik Grid:

columns.Bound("ColumnName").Aggregate(aggregates => aggregates.Count().Min().Max())

If I try and set up the agregate down in the DataSource I get a lovely exception “‘count’ is undefined” which is a bit vague.

if (column.ColumnName == "ProductID")
{
    columns
        .Bound(column.DataType, column.ColumnName)
        .ClientFooterTemplate("Count: #=count#");
}
...
.Aggregates(aggregates =>
{
aggregates.Add(a => "ProductID").Count();
})

Is there any way to get around the aggregate problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:19:28+00:00Added an answer on June 18, 2026 at 4:19 am

    Though this does not solve the problem with doing sum functions on the datagrid, this answer was provided by the Kendo UI/Telerik support team, and does resolve the question asked above about the count function:

    @(Html.Kendo().Grid<dynamic>()
        .Name("Grid")
        .Columns(columns =>
        {
            foreach (System.Data.DataColumn column in Model.Columns)
            {
    
                var boundColumn = columns.Bound(column.ColumnName);
                if (column.ColumnName == "ProductID")
                {
                    boundColumn.ClientFooterTemplate("#= data.ProductID !== undefined ? ProductID.count : ''#");
                }
            }
        })
        .Pageable()
        .Sortable()
        .AutoBind(false)
        .Scrollable()
        .Filterable()
        .Groupable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model =>
                {
                    foreach (System.Data.DataColumn column in Model.Columns)
                    {
    
                        model.Field(column.ColumnName, column.DataType);
                    }
                })
            .Read(read => read.Action("Read", "Home"))
        )
    )
    
    <script>
        $(document).ready(function () {
            var grid = $("#Grid").data("kendoGrid");
            grid.dataSource.aggregate(
                [
                    {
                        field: "ProductID",
                        aggregate: "count"
                    }
                ]);
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some Rspec model specs, we have several tests like this: it { should
Here's the specs: ASP.NET 3.5 using ASP.NET AJAX AJAX Control Toolkit jQuery 1.3.2 web
I have a set of request specs written using RSpec2 and Capybara. Here's one
System specs: C# client using .NET 3.0. WCF services hosted as windows services on
I have a small project with Jasmine specs and I am using Testacular as
I have two specs from two different hosts I am using: (a) Dedicated server
I have a number of view specs that need certain methods to be stubbed.
I cannot get request specs working when using Javascript. My specs pass if I
Specs GHC 6.12.1 Mac OS X 10.6.4 x64 MacBook Pro Problem I'm having trouble
Suppose I want to have the following specs: it { should allow_value(git://host.xz/path/to/repo.git/).for(:url) } it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.