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

Custom toolbar in grid error CS1525: Invalid expression term ')'

1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Matthew asked on 23 Sep 2013, 07:15 PM
Hello, after trying to follow the examples for adding a toolbar in the grid and AS soon as I add in the toolbar I get the error in the title. 

here's the aspx code: 
<%: Html.Kendo().Grid<TSAEMSV3.Models.AirportTrainingViewManagementModel>()
    .Columns(columns =>
            columns.Bound(x => x.Record).Width(65);
            columns.Bound(x => x.Code).Width(65);
            columns.Bound(x => x.PeopleTrained).Width(100);
            columns.Bound(x => x.TrainingTypes).Width(100);
            columns.Bound(x => x.Trainer).Width(100);
            columns.Bound(x => x.TrainingDate).Format("{0:MM/dd/yyyy}").Width(100);
    .ToolBar(toolbar =>
            toolbar.Template(() =>
            { %>
               <div class="toolbar">
                        <label class="category-label" for="category">Show products by category:</label>
    .HtmlAttributes(new { style = "height:500px;" })
    .DataSource(dataSource => dataSource
            .Read(read => read.Action("RetrieveTrainingManagementGrid", "AirportTraining"))
I have tried using the .Render() as well at the end of the control but no success.  Any help would be greatly appreciated. 

1 Answer, 1 is accepted

Sort by
Alexander Popov
Telerik team
answered on 25 Sep 2013, 01:09 PM
Hello Matthew,

I tried to reproduce the problem locally using the toolbar template from your post – everything is working as expected and no errors were produced. Could you please provide runnable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

On a side note I would recommend checking the following blog post:

Alexander Popov
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question