Features

グループパネル

グループパネル

グループパネル機能では、ドラッグドロップグループ化UIを任意のMultiRowコントロールに追加できます。

機能

設定

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> {"Drag columns here to create Groups", "Drag columns here..."}, CurrentValue = "Drag columns here to create Groups"}}
            }
        };

        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)
)
@section Settings{
    @Html.Partial("_OptionsMenu", optionsModel)
}

@section Summary{
    @Html.Raw(Resources.MultiRowExplorer.GroupPanel_Text0)
}