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

[Solved] How can we have custom toolbar template grid inside tab strip?

2 Answers 174 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajesh Ramanathan
Top achievements
Rank 1
Rajesh Ramanathan asked on 09 May 2011, 12:14 PM
Hi,

I am trying to use custom toolbar template grid inside tab strip but didn't get through as it doesn't allow multiple inline markups and throws " Only one level of inline markup is allowed." error.

 @(Html.Telerik().TabStrip()
.Name("Topics")
.SelectedIndex(0)
.HtmlAttributes(new { style = string.Format("width:155%") })
.Items(TabStrip =>
      {
          TabStrip.Add()
              .Text("Valid")
 
              .Content(@<text> @(Html.Telerik().Grid(Model)
              .Name("gd")
              .ToolBar(toolbar => toolbar.Template(@<text>
            @(Html.Telerik().DropDownList()
            .Name("ddlCountry")
                        .SelectedIndex(0)
            .BindTo(new SelectList(cnt, "id", "Name"))
            .ClientEvents(events => events
                                .OnChange("cntChange")
                )
            .HtmlAttributes(new { style = string.Format("width:{0}px", 150) })
            )
            </text>))
              .Columns(columns =>
            {
                columns.Bound(b => b.icon)
                    .ClientTemplate(" <img alt='<#= icon#>' style='width:30px;height:auto' src='" + Url.Content("~/images/") + "<#= icon#>' />")
                    .Title("Img1").Width(20);
                columns.Bound(b => b.Name).Width(20);
                columns.Bound(b => b.Seq).Width(20);
 
            })
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_Index", "Home"))
                .HtmlAttributes(new { style = string.Format("width:100%") })
            )
            </text>);
      }).HtmlAttributes(new { style = string.Format("width:100%") }))

Is there any other way out for this?

Thanks !!

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 May 2011, 06:10 AM
Hello Rajesh Ramanathan,

 This is a well known limitation of the Razor view engine. As a workaround you can use a helper as described here.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Serguei
Top achievements
Rank 1
answered on 18 Jul 2011, 04:01 AM
Hi Atanas
You mentioned "well known limitation of the Razor view engine". Could you please add reference to this post. I spent almost a week trying to get updatable grid working with tabstrip and so far no luck. These might be due to the limitations you mentiobned above.
Thanks 
Tags
TabStrip
Asked by
Rajesh Ramanathan
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Serguei
Top achievements
Rank 1
Share this question
or