Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2715
iggrid model empty on postback
posted

Im trying to create a master / detail create page in mvc 5

at the top I have normal text input fields

at the buttom I have a grid

when I post back the data I entered in the grid is not there

the model look like this

public Bestiller bestilleren { get; set; }
public IQueryable<Kontaktperson> kontaktpersoner { get; set; }

and the grid :

@(Html.Infragistics().Grid(Model.kontaktpersoner)
.PrimaryKey("ID")
.ID("grdKontaktpersoner")
.ShowHeader(true)
.Columns(column =>
{
column.For(m => m.ID).Hidden(true);
column.For(m => m.Navn).HeaderText("Navn").Width("200px");
column.For(m => m.E_Mail).HeaderText("Email").Width("200px");
column.For(m => m.Tlfnr).HeaderText("Telefonnr.").Width("80px");
column.For(m => m.RefNr).HeaderText("Ref. Nr.").Width("100px");
})
.Features(feature =>
{
feature.Updating().ColumnSettings(cs =>
{
cs.ColumnSetting().ColumnKey("ID").ReadOnly(true);
cs.ColumnSetting().ColumnKey("Navn").EditorType(ColumnEditorType.Text).Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.MaxLength(50)));
cs.ColumnSetting().ColumnKey("E_Mail").EditorType(ColumnEditorType.Text).TextEditorOptions(o =>
.ValidatorOptions(vo => vo.MaxLength(60)));
cs.ColumnSetting().ColumnKey("Tlfnr").EditorType(ColumnEditorType.Text).TextEditorOptions(o => o.ValidatorOptions
vo => vo.MaxLength(20)));
cs.ColumnSetting().ColumnKey("RefNr").EditorType(ColumnEditorType.Text).TextEditorOptions(o => o.ValidatorOptions
vo => vo.MaxLength(30)));
})
.CancelLabel("Afbryd")
.AddRowLabel("Tilføj kontaktperson")
.DeleteRowTooltip("Slet kontaktperson")
.DoneLabel("Gem")
.EditMode(GridEditMode.Row)
.EnableDeleteRow(true);
})
.AutoGenerateColumns(false)
.AutoAdjustHeight(true)
.AutoCommit(true)
.Width("100%")
.DataSource(Model.kontaktpersoner)
.DataBind()
.Render()
)

I use 2014.1  sr 2249