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

[Solved] Invalid expression term in Template statement

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
adsf adsf
Top achievements
Rank 1
adsf adsf asked on 12 May 2010, 09:16 PM
I keep getting this error when trying to add a Template.  It seems pretty straightforward, but it just doesn't want to parse correctly.  Can anyone else see the problem here?  The error is:

(14): error CS1525: Invalid expression term ')'

Where line 14 is the line after columns.Template




 <%= Html.Telerik().Grid(Model) 
        .Name("ProjectsGrid"
        .Columns(columns => 
            { 
                columns.Template(u => 
                { 
                     
                    %> 
                    <%=Html.ActionLink("Details""Details"new { id = u.ProjectKey })%> 
                    <% 
                }); 
                columns.Bound(o => o.Name); 
                columns.Bound(o => o.Sponsor); 
                columns.Bound(o => o.FirstProjectTypeName).Filterable(false).Sortable(false).Title("Type"); 
                columns.Bound(o => o.FirstProjectCategoryName).Filterable(false).Sortable(false).Title("Category"); 
                columns.Bound(o => o.FirstProjectStatusName).Filterable(false).Sortable(false).Title("Status"); 
                columns.Bound(o => o.EnteredBy); 
                columns.Bound(o => o.QualityRank.Designation).Column.Title = "Quality Rank"
                columns.Bound(o => o.SafetyRank.Designation).Column.Title = "Safety Rank"
                columns.Bound(o => o.BusinessRank.Designation).Column.Title = "Business Rank"
            }) 
                   .Pageable() 
                   .Sortable() 
                   .Filterable() 
                   .Render(); 
 
    %> 



1 Answer, 1 is accepted

Sort by
0
adsf adsf
Top achievements
Rank 1
answered on 13 May 2010, 05:53 PM
The problem turned out to be in the first line of code.  The '=' sign on the opening statement was causing the issue.  Another review of the documentation provided a reminder:

If template columns are defined the <% Html.Telerik().Grid().Render(); %> definition should be used instead of <%= Html.Telerik().Grid() %>
Tags
Grid
Asked by
adsf adsf
Top achievements
Rank 1
Answers by
adsf adsf
Top achievements
Rank 1
Share this question
or