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

3 posts, 0 answers
  1. Siva Prasad
    Siva Prasad avatar
    11 posts
    Member since:
    Mar 2011

    Posted 15 May 2014 Link to this post

    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. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 19 May 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Elton
    Elton avatar
    1 posts
    Member since:
    Dec 2014

    Posted 3 days ago in reply to Alexander Popov Link to this post

    This post really helped me and got me out of a "3" day circular jam! Thanks!!
Back to Top