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

Grid server template

1 Answer 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris Williams
Top achievements
Rank 1
Chris Williams asked on 16 Aug 2012, 09:18 PM
Is this form of server template creation supported in Kendo/MVC?

.Template(t =>
    {
       @<text>
       This is my custom template
       </text>
    }                                                       
 )

I've seen server templates created like this but not like the above.

1 Answer, 1 is accepted

Sort by
0
Chris Williams
Top achievements
Rank 1
answered on 16 Aug 2012, 09:26 PM
OK, this seems to work.

.Template(t =>
              {
                  IDictionary<String, Object> values = (IDictionary<String, Object>) t;
                  object value;
                  values.TryGetValue(string.Concat(series.Source, "-", series.Field), out value);
                  return Html.WriteValue(values, value, series);
              }                                                                                              
)
Tags
Grid
Asked by
Chris Williams
Top achievements
Rank 1
Answers by
Chris Williams
Top achievements
Rank 1
Share this question
or