@model IEnumerable<FlexGridData.Sale>

<h1>
    Read-Only, Required Columns
</h1>
<p>
    You can disable editing at the grid, column, or row levels
    using the <b>isReadOnly</b> property of the grid, column,
    or row objects respectively. You can also disable editing 
    for specific cells using the <b>cellEditStarting</b> event.
</p>
<p>
    You can use the column's <b>isRequired</b> property to
    determine whether empty/null values should be allowed
    for that column.
</p>
<p>
    The grid below prevents users from entering empty
    values for the 'Country' column, and allows them to delete
    the content of the numeric columns.
</p>
<p>
    The grid also uses the <b>beginningEdit</b> event to
    prevent users from editing items that are overdue:
</p>
@(Html.C1().FlexGrid().Id("theGrid").Height(200)
    .AutoGenerateColumns(false)
    .Bind(Model)
    .Columns(cs=>
    {
        cs.Add().Binding("Id").Header("ID").Width("50").IsReadOnly(true);
        cs.Add().Binding("Country").Header("Country").IsRequired(true);
        cs.Add().Binding("Sales").Header("Sales").IsRequired(false);
        cs.Add().Binding("Expenses").Header("Expenses").IsRequired(false);
        cs.Add().Binding("Overdue").Header("Overdue");
    })
)