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

Embed a Grid in a TabStrip

1 Answer 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
YY
Top achievements
Rank 1
YY asked on 11 Jul 2013, 06:15 PM
I think this should be simple, I just can't quite seem to get it.  I have a TabStrip which I want to embed a grid into one of the tabs.  The grid should load dynamically from AJAX.  I have both working independently, but when I try to put the Grid into the TabStrip, I get no content.  I can see in firebug there is never a request being made for the content.

01.@(Html.Kendo().TabStrip() _
02.    .Name("tabstrip") _
03.    .Items(Sub(tabstrip)
04.        tabstrip.Add().Text("Delivery Tickets") _
05.            .Selected(True) _
06.            .Content(Sub()
07.                Html.Kendo().Grid(Of DeliveryTicketDisplay) _
08.                    .Name("Grid") _
09.                    .Columns(Sub(c)
10.                        c.Bound(Function(x) x.DeliveryTicketID)
11.                        c.Bound(Function(x) x.TicketDate)
12.                        c.Bound(Function(x) x.CustomerID)
13.                        c.Bound(Function(x) x.Location)
14.                    End Sub) _
15.                .DataSource(Sub(dataSource)
16.                    dataSource _
17.                    .Ajax() _
18.                    .Read(Function(reader) reader.Action("List", "DeliveryTicket", New With {.CustomerID = Model.CustomerID}))
19.                End Sub)
20.            End Sub)
21.                                                   
22.        tabstrip.Add().Text("Contacts") _
23.            .LoadContentFrom("List", "Contact", New With {.CustomerID = Model.CustomerID})
24.    End Sub)
25.)

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Jul 2013, 11:17 AM
Hi,

You should use the Render method to output the control when an action is used e.g.

@Code Html.Kendo().TabStrip() _
    .Name("tabstrip") _
    .Items(Sub(tabstrip)
               tabstrip.Add().Text("Delivery Tickets") _
                  .Selected(True) _
                  .Content(Sub()
                       Html.Kendo().Grid(Of DeliveryTicketDisplay)() _
                          .Name("Grid") _
                          ...
                          .Render()
                   End Sub)
           End Sub) _
    .Render()
End Code


Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
YY
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or