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

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    1 posts
    Member since:
    Sep 2013

    Posted 23 Sep 2013 Link to this post

    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>()
        .Name("grid")
     
        .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>
                                 
                                </div>
                <%});
            })
        .Pageable()
        .Sortable()
        .Scrollable()
        .HtmlAttributes(new { style = "height:500px;" })
        .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(50)
                .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. 
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1441 posts

    Posted 25 Sep 2013 Link to this post

    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:

    Regards,
    Alexander Popov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top