@model IEnumerable<FlexGridData.Sale>

<h1>
    CollectionView Grouping
</h1>

<p>
    Use the <b>CollectionView.groupDescriptions</b> property to specify
    which fields should be grouped.
</p>
<p>
    Choose one of the options to see it in action:
</p>

<label>
    <input type="radio" name="filter" value="" checked="true" />
    No Grouping
</label>
<label>
    <input type="radio" name="filter" value="Country" />
    By Country
</label>
<label>
    <input type="radio" name="filter" value="Country,Product" />
    By Country and by Product
</label>
<label>
    <input type="radio" name="filter" value="Country,Product,Sales" />
    By Country, Product, and Sales
</label>

<p>
    Result:
    <button id="btnDump" class="btn btn-default">
        Show on Console
    </button>

</p>
@(Html.C1().FlexGrid().Id("theGrid").Height(250)
    .ShowAlternatingRows(false)
    .HeadersVisibility(C1.Web.Mvc.Grid.HeadersVisibility.Column)
    .OrderByDescending("Sales")
    .Bind(b=>b.Bind(Model).DisableServerRead(true))
    .AutoGenerateColumns(false)
    .Columns(cs=>
    {
        cs.Add().Binding("Id").Header("ID");
        cs.Add().Binding("Country").Header("Country");
        cs.Add().Binding("Product").Header("Product");
        cs.Add().Binding("Sales").Header("Sales");
        cs.Add().Binding("Expenses").Header("Expenses");
    })
)