Telerik Extensions for ASP.NET MVC

Version Q2 2012, released 06/07/2012

Server Detail Template

 First NameLast NameTitleCountryCity
NancyDavolioSales RepresentativeUSASeattle
 
Order IDShip CountryShip AddressShip NameShipped Date
10258AustriaKirchgasse 6Ernst Handel7/23/1996
10270FinlandTorikatu 38Wartian Herkku8/2/1996
10275ItalyVia Ludovico il Moro 22Magazzini Alimentari Riuniti8/9/1996
10285GermanyTaucherstraße 10QUICK-Stop8/26/1996
10292BrazilAv. Inês de Castro, 414Tradiçao Hipermercados9/2/1996
10293MexicoAvda. Azteca 123Tortuga Restaurante9/11/1996
10304MexicoAvda. Azteca 123Tortuga Restaurante9/17/1996
10306SpainGran Vía, 1Romero y tomillo9/23/1996
10311France67, rue des Cinquante OtagesDu monde entier9/26/1996
10314USA2817 Milton Dr.Rattlesnake Canyon Grocery10/4/1996
Displaying items 1 - 10 of 123
Nancy Davolio
  • 12/8/1948
  • USA
  • Seattle
  • 507 - 20th Ave. E. Apt. 2A
  • (206) 555-9857
AndrewFullerVice President, SalesUSATacoma
JanetLeverlingSales RepresentativeUSAKirkland
MargaretPeacockSales RepresentativeUSARedmond
StevenBuchananSales ManagerUKLondon
Displaying items 1 - 5 of 9

About this example ASPXRazor

This example shows how to use the server detail template - the detail template used in server binding scenarios.

Important notes:

  1. Use the Template method to set the server template (used only for server binding scenarios).
  2. Make sure the Name of any UI component defined in the template is unique. A property of the bound object can be used to ensure such uniqueness: Name("TabStrip_" + e.EmployeeID).
  3. Calling the Render method is required in order to output the contents of any UI components defined in the server detail template.

Example:

<% Html.Telerik().Grid(Model)
    .Name("Employees")
    .DetailView(detailView => detailView.Template(e =>
    {
        %>
            <% Html.Telerik().TabStrip()
                .Name("TabStrip_" + e.EmployeeID)
                .SelectedIndex(0)
                .Items(items =>
                {
                    items.Add().Text("Orders").Content(() =>
                    {
                        %>
                            <%= Html.Telerik().Grid(e.Orders)
                                   .Name("Orders_" + e.EmployeeID)
                                   .Pageable()
                                   .Sortable()
                            %>
                        <%
                    });
                    items.Add().Text("Contact Information").Content(() =>
                    {
                        %>
                            <div class="employee-details">
                                <ul>
                                    <li>
                                        <label>Birth Date:</label><%= e.BirthDate.Value.ToString("d") %>
                                    </li>
                                    <li>
                                        <label>Country:</label><%= e.Country %>
                                    </li>
                                    <li>
                                        <label>City:</label><%= e.City %>
                                    </li>
                                    <li>
                                        <label>Address:</label><%= e.Address %>
                                    </li>
                                    <li>
                                        <label>Home Phone:</label><%= e.HomePhone %>
                                    </li>
                                </ul>
                            </div>
                        <%
                    });                                                       
                })
                .Render();
             %>
        <%    
    }))
    .Pageable(paging => paging.PageSize(5))
    .Sortable()
    .Render();
%>

Interested in HTML5 and mobile-powered ASP.NET MVC apps?

Experience the next generation UI and framework for ASP.NET MVC development by downloading trial evaluation copy of Kendo UI Complete for ASP.NET MVC. Jumpstart your development with the available learning resources.

The differences between Telerik MVC Extensions and Kendo UI Complete for ASP.NET MVC, and their licensing models are explained here and here.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Other Demos: