grid Toolbar always errors

2 posts, 0 answers
  1. Kahl
    Kahl avatar
    15 posts
    Member since:
    Nov 2016

    Posted 08 May 2017 Link to this post

    I am trying to add a DDL to a toolbar template,  I have tried all sorts , including simple text in the toolbar.

     

    But when I add the template , I always get a syntaxthe character befor the ampersand  (@<text>  as if the toolbar.template does not like the string as a paramater.  What could be wrong here .

     

    My current code is below

     

    I have tried simple divs with text and other things ,  but the issue is always the same.

     

      .ToolBar(toolbar =>
                                                            {
                                                              
                                                            toolbar.Template( @<text>
                                                                        <div class="toolbar">
                                                                            @(Html.Kendo().DropDownList()
                                                                                        .Name("CityId")
                                                                                        .DataTextField("Name")
                                                                                        .DataValueField("Value")
                                                                                        .OptionLabel("Select City...")
                                                                                    .DataSource(source => source
                                                                                      .ServerFiltering(true)
                                                                                      .Custom()
                                                                                      .Transport(transport => transport
                                                                                            .Read(read =>
                                                                                            {
                                                                                                read.Url("/Api/Common/_GetCity/2")
                                                                                                .DataType("json");

                                                                                            })
                                                                                     )
                                                                                        )
                                                                            )
                                                                        </div>
                                                                </text>);




                                                            })

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2495 posts

    Posted 10 May 2017 Link to this post

    Hello Kahl,

    I have examined the code and it looks correct to me. It is using the same approach as the one illustrated in the example below.


    With that said, the code in Template() is evaluated on the server. However, if you are using ASP.NET Core server-side rendering is not supported

    If you are targeting ASP.NET MVC please send us a sample project where the behavior is replicated so we can examine it.


    Regards,
    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top