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

HtmlAttributes on columns causes an "invalid template" error

0 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gm
Top achievements
Rank 1
gm asked on 13 Jun 2013, 11:11 AM
I am migrating an application from release 2012.3.1114 to release 2013.1.319.

Previously, I was able to apply HtmlAttributes on columns in this manner:
@(Html.Kendo().Grid<ToolListItemView>().Name("texListGrid")
    .Columns(columns => {
        columns.Bound(m => m.ToolId);
        columns.Bound(m => m.Description).HtmlAttributes(new { style = "font-size: 1.3em;" });
        columns.Bound(m => m.LastModified);
        columns.Bound(m => m.ConditionName);
        columns.Bound(m => m.LocationName);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("ToolsRead", "List").Data("listParams"))
    )
)
With release 2013.1.319, an "invalid template" error is generated from the above code.  If I change HtmlAttributes to HeaderHtmlAttributes, no errors are generated and the style is applied to the column header (i.e. the format of the HtmlAttributes isn't a problem).  I did verify that I could use HtmlAttibutes on a column with an @class parameter successfully, which is the correct way of applying styles.  I guess I'm wondering if this capability (local CSS styling via HtmlAttributes) was intentionally removed, or if I'm doing something wrong?

Edit: Sorry - I should have been posted this in the Kendo UI Complete for ASP.NET MVC forum.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
gm
Top achievements
Rank 1
Share this question
or