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

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

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew
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>()
    .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. 

1 Answer, 1 is accepted

Sort by
0
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:

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