@(Html.Infragistics().Grid(Model.Addresses.AsQueryable())
.ID("ba_addresses")
.Width("100%")
.AutoGenerateColumns(false)
.PrimaryKey("AddressID")
.AutoCommit(true)
.Columns(column =>
{
column.For(x => x.AddressID).HeaderText("AddressID").Width("5%").DataType("number");
column.For(x => x.Purpose).HeaderText("Purpose").Width("10%").DataType("string");
column.For(x => x.AddressDetails).HeaderText("Address Details").Width("20%").DataType("string");
column.For(x => x.City).HeaderText("City").Width("10%").DataType("string");
column.For(x => x.Province).HeaderText("Province").Width("8%").DataType("string");
column.For(x => x.Country).HeaderText("Country").Width("7%").DataType("string");
column.For(x => x.Zipcode).HeaderText("Postal Code").Width("10%").DataType("string");
column.For(x => x.Email).HeaderText("Email").Width("14%").DataType("string");
column.For(x => x.Phone).HeaderText("Phone").Width("8%").DataType("string");
column.For(x => x.Fax).HeaderText("Fax").Width("8%").DataType("string");
})
.Features(feature =>
{
feature.Updating().EnableDeleteRow(false).ColumnSettings(cs =>
{
cs.ColumnSetting().ColumnKey("AddressID").ReadOnly(true);
cs.ColumnSetting().ColumnKey("Purpose").Required(true).EditorType(ColumnEditorType.Combo).ComboEditorOptions(ad => ad.DataSource(Model.AddressPurposes).ValueKey("Value").TextKey("Value"));
cs.ColumnSetting().ColumnKey("AddressDetails").Required(true);
cs.ColumnSetting().ColumnKey("City").Required(true);
cs.ColumnSetting().ColumnKey("Zipcode").Required(true);
cs.ColumnSetting().ColumnKey("Province").Required(true);
cs.ColumnSetting().ColumnKey("Country").Required(true);
});
feature.Sorting();
feature.Filtering();
feature.Resizing().AllowDoubleClickToResize(true);
feature.Hiding();
feature.ColumnMoving();
feature.Paging().PageSize(15).Type(OpType.Local).ShowPagerRecordsLabel(true);
})
.UpdateUrl(Url.Action("BAAddressSaveData"))
.DataBind()
.Render())
@section scripts{
@Html.Partial("_ba_search_box", Model.BizAssociate)
}