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

How to access a field in a client template

1 Answer 463 Views
Grid
This is a migrated thread and some comments may be shown as answers.
WenatexIT
Top achievements
Rank 1
WenatexIT asked on 30 Nov 2015, 03:08 PM

Hi

 

I have a sum-row in my grid and I want to do a calculation with a fixed value from my database

 

So, passing it via the ViewModel won't work, has anyone a suggestion other than sending the value with each row of the dataset?

 

.ClientFooterTemplate("<div class=\"total_sum\">" + @Labels.Total + ": #= sum # = #= sum * [INSERT VALUE HERE] # €</div>");

 

Kind regards

Florian

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 02 Dec 2015, 08:16 AM
Hello,

Maybe you can use the ViewBag property to pass it from controller to the View where it can be accessed in javascript:
http://stackoverflow.com/questions/10008023/how-do-i-access-viewbag-from-js

Regards,
Marin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
WenatexIT
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or