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

attempting to load a grid into the content of the first tab in a tabstrip

2 Answers 106 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Siva Prasad
Top achievements
Rank 1
Siva Prasad asked on 16 May 2014, 03:58 AM
Hi Team,

We are attempting to load a grid into the content of the first tab in a tab-strip. We had tried several variations of the code and how the grid loads, including via the "activate" event. The grid works with the tab-strip code commented out.

Please provide an appropriate solution for our problem as soon as possible.

Thanks,
Siva

2 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 19 May 2014, 03:49 PM
Hello Siva,

This could be achieved by declaring the Grid inside the content of the desired tab. For example: 
@(Html.Kendo().TabStrip()
      .Name("tabstrip")
      .Items(tabstrip =>
      {
          tabstrip.Add().Text("Grid")
              .Selected(true)
              .Content(@<text>
               @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()   
                        .Name("grid")
                        .Columns(columns => {
                            columns.Bound(p => p.OrderID).Filterable(false).Width(100);
                            columns.Bound(p => p.Freight).Width(100);
                            columns.Bound(p => p.OrderDate).Format("{0:MM/dd/yyyy}").Width(140);
                            columns.Bound(p => p.ShipName);
                            columns.Bound(p => p.ShipCity).Width(150);
                        })
                        .Pageable()
                        .Sortable()
                        .Scrollable()
                        .Filterable()
                        .HtmlAttributes(new { style = "height:430px;" })
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)
                            .Read(read => read.Action("Orders_Read", "Grid"))
                         )
                    )
              </text>);
 
          tabstrip.Add().Text("Text")
              .Content(@<text>asdas asd asd asd </text>);
      })
)


Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Elton
Top achievements
Rank 1
answered on 06 Dec 2016, 08:40 PM
This post really helped me and got me out of a "3" day circular jam! Thanks!!
Tags
TabStrip
Asked by
Siva Prasad
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Elton
Top achievements
Rank 1
Share this question
or