5

I am using AJAX bound Telerik MVC grid. I am sending data for the grid using a code like the following:

return View(new GridModel(...));

I want to be able to send additional data to client in the same action method. For example I need to send a single int value Total, which is to be shown above the grid (this value must be fetched from db, it cannot be evaluated client-side).

Please share any ideas.

2
  • I found the answer in the following Telerik forum thread telerik.com/community/forums/aspnet-mvc/grid/… Commented Mar 13, 2012 at 11:30
  • 1
    Can you post the solution to your problem please, the link you posted doesn't exist anymore Commented Jun 25, 2015 at 10:07

1 Answer 1

1

To achieve your desired result, you could add a client footer template bound to the property passed down from your model as follows:

columns.Bound(o => o.UnitPrice)
       .ClientFooterTemplate("<#= Total #>");

There is also a good example detailing the use of server aggregates on the Telerik site if you wanted to work these out using aggregate functions in the future.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for you response, but it's not exactly what I needed, I have resolved the issue, see the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.