@model IEnumerable<FlexGridData.Sale>

<h1>
    Custom Editing
</h1>
<p>
    Although FlexGrid provides efficient, Excel-style
    editing by default, you may want to customize the
    editing behavior in some cases.
</p>
<p>
    The simplest customization is to keep the grid
    always in edit mode. This does not save any 
    effort of the user, because anyways, FlexGrid allows
    editing cells by typing at any time. But, it does 
    show users that the grid is editable.
</p>
<p>
    The easiest way to keep the grid in edit mode at
    all times is to call the <b>startEditing</b>
    method when the grid gets the focus and when the
    selection changes.
</p>

@(Html.C1().FlexGrid().Id("theGrid").Height(200)
    .AutoGenerateColumns(false)
    .Bind(Model)
    .Columns(cs =>
    {
        cs.Add().Binding("Id").Header("ID").Width("50");
        cs.Add().Binding("Country").Header("Country").IsRequired(true);
        cs.Add().Binding("Sales").Header("Sales");
        cs.Add().Binding("Expenses").Header("Expenses");
        cs.Add().Binding("Overdue").Header("Overdue");
    })
)