using MultiRowExplorer.Models;
using System.Collections.Generic;
using System.Web.Mvc;
namespace MultiRowExplorer.Controllers
{
public partial class MultiRowController : Controller
{
private readonly ControlOptions _groupPanelOptions = new ControlOptions
{
Options = new OptionDictionary
{
{"Max Groups", new OptionItem {Values = new List<string> {"3", "4", "5", "6"}, CurrentValue = "3"}},
{"Placeholder", new OptionItem {Values = new List<string> {Resources.MultiRowExplorer.GroupPanel_Text1, Resources.MultiRowExplorer.GroupPanel_Text2}, CurrentValue = Resources.MultiRowExplorer.GroupPanel_Text1}}
}
};
public ActionResult GroupPanel(FormCollection data)
{
_groupPanelOptions.LoadPostData(data);
ViewBag.DemoOptions = _groupPanelOptions;
return View(Orders.GetOrders());
}
}
}
@using C1.Web.Mvc.Grid
@model IEnumerable<Orders.Order>
@{
ControlOptions optionsModel = ViewBag.DemoOptions;
ViewBag.DemoSettings = true;
ViewBag.DemoDescription = false;
}
@(Html.C1().MultiRow<Orders.Order>()
.Id("groupPanelMultiRow")
.ShowGroupPanel(s => s
.MaxGroups(Convert.ToInt32(optionsModel.Options["Max Groups"].CurrentValue))
.Placeholder(optionsModel.Options["Placeholder"].CurrentValue))
.Bind(Model)
.CssClass("multirow")
.IsReadOnly(true)
.LayoutDefinition(LayoutDefinitionsBuilders.ThreeLines)
.AllowDragging(AllowDragging.Columns)
)
@section Settings{
@Html.Partial("_OptionsMenu", optionsModel)
}
@section Summary{
@Html.Raw(Resources.MultiRowExplorer.GroupPanel_Text0)
}