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

Place variable in title

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chili
Top achievements
Rank 1
Chili asked on 04 Dec 2018, 10:24 AM

As you have read the title. I want to add a variable in my title. When I put a property in my model, and also define the model in my div. It still gives me the error:

The name 'property' does not exist in the current. But when I add series for example I can do Model => Model.propname Why is it not possible to do this? sTotalCount is in Model2
The code:

@model model1
 
 
 
<div class="demo-section k-content wide">
    @(Html.Kendo().Chart<App.Model2>()
    .Name("test" + Model1.ID)
    .Title(sTotalcount + "this is the total")


1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 07 Dec 2018, 07:55 AM
Hi Chili,

The expression in the Series is only for specifying which property should be used and it does not populate any particular value from the DataSource directly. This means that it is not possible to get particular value from the DataSource and set it as a "Title" of the Chart. You could however use a value from ViewModel ("model1").


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Chili
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or