<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<GridAndTabStrip.Models.Employee>>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
  
  <h2>TabStrip and posting grid</h2>
  
   <% Html.Telerik().TabStrip()
            .Name("AdminTab")
            .Items(tabstrip =>
            {
                tabstrip.Add()
                    .Text("FakeData1")
                    .LoadContentFrom("LoadOnDemandDocument", "Home");

                tabstrip.Add()
                    .Text("FakeData2")
                    .Content(() => { 
                        %>
                            <p>
                                Telerik Extensions for ASP.NET MVC is built from the ground up to fully embrace
                                the values of the ASP.NET MVC framework - lightweight rendering, clean HTML,
                                clear separation of concerns, easy testability - while helping make
                                you more productive building MVC views. 
                            </p>
                        <%
                    });

                tabstrip.Add()
                    .Text("Grid")
                    .Content(() =>
                    {
                        Html.Telerik().Grid(Model)
                            .Name("Employees")
                            .Pageable(pager => pager.PageSize(2))
                            .Columns(columns =>
                            {
                                columns.Add(o => o.EmployeeID).Width(50);
                                columns.Add(o => o.FirstName).Width(50);
                                columns.Add(o => o.LastName).Width(50);
                                columns.Add(o => o.Address).Width(100);
                                columns.Add(o => o.City).Width(50);
                            })
                            .ServerBinding(binding=>binding.Action("PostBackGridInTabStrip", "Home", new {tabIndex=2}))
                            .Render();
                    });
            })
            .SelectedIndex((int)ViewData["tabIndex"])
            .Render();
        %>
</asp:Content>
