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

grid Toolbar always errors

1 Answer 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kahl
Top achievements
Rank 1
Kahl asked on 08 May 2017, 09:48 AM

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>);




                                                        })

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 10 May 2017, 08:13 AM
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.
Tags
Grid
Asked by
Kahl
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or