@model KendoUIMvcApplication5.Models.UnitModel
@using Kendo.Mvc
@using KendoUIMvcApplication5.Models

@{
    ViewBag.Title = "About";
}

<hgroup class="title">
    <h1>@ViewBag.Title.</h1>
    <h2>@ViewBag.Message</h2>
</hgroup>

<article>
    <p>
        @using (Html.BeginForm("Submit", "Home"))
        {
            foreach (var o in ViewBag.Units)
            {
                var optionValue = "MyOptions_" + o.UnitID;
                <input type="checkbox" 
                   id="@optionValue"
                   name="PostedIDs"
                   value="@o.UnitID"/>
                <label for="@optionValue">@o.UnitName</label>
                <br />
            }
            
            <input type="submit" value="submit"/>
        }
    </p>

    <p>
        Use this area to provide additional information.
    </p>

    <p>
        Use this area to provide additional information.
    </p>
</article>

<aside>
    <h3>Kendo UI TreeView</h3>
    <p>
        @(Html.Kendo().Grid<UnitModel>()
        .Name("Grid")
        .DataSource(ds => ds.Ajax()
                            .Model(model => model.Id(field => field.UnitID))
                            .Read(read => read.Action("Read", "Home"))
                            .Update(update => update.Action("Update", "Home"))
                            )
                            .Columns(columns =>
                                {
                                    columns.Bound(model => model.UnitName);
                                    columns.Command(cmd => cmd.Edit());
                                })
                                .Editable(edit => edit.Mode(GridEditMode.PopUp).TemplateName("EditUnitModel"))
        )
    </p>

    @(Html.Kendo().TreeView()
        .Name("LinksTreeView")
        .Items(items =>
        {
            items.Add()
                .Text("Home")
                .Action("Index", "Home");
            items.Add()
                .Text("About")
                .Action("About", "Home");
            items.Add()
                .Text("Contact")
                .Action("Contact", "Home");
        })
    )

</aside>
