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

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.Telerik().Grid(Model)
        .Name("MovieSet")
        .Pageable()
        .Sortable()
        .DataKeys(keys => keys.Add(c => c.Id))
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" }))
        .DataBinding(dataBinding => dataBinding.Server()
              .Select("EditingServerSide", "Home", new { mode = GridEditMode.PopUp, type = GridButtonType.Text })
              .Insert("Insert", "Home", new { mode = GridEditMode.PopUp, type = GridButtonType.Text })
              .Update("Save", "Home", new { mode = GridEditMode.PopUp, type = GridButtonType.Text })
              .Update("Delete", "Home", new { mode = GridEditMode.PopUp, type = GridButtonType.Text })
            )
        .Columns(columns =>
        {
            columns.Bound(o => o.Id).Title("ID");
            columns.Bound(o => o.Title).Title("Title");
            columns.Bound(o => o.Director).Title("Director");
            columns.Bound(o => o.DateReleased).Title("Date Released");
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.ImageAndText);
            }).Width(180).Title("Commands");
            
            
        
        })
        .Render();
    %>

</asp:Content>
