When I use the example for the jquery grid the combo dropdown works on the editing of a column however when I use the MVC helper it does not and instead when editing the column it renders as a textbox.
I've tried running both examples side by side in the same web page to ensure it wasn't something to do with the script loading of jquery/infragistics or the type differences but still it only works on the jQuery version.
Here is how I'm instantiating my mvc grid.
<div class="row col-sm-12 col-lg-12 col-md-12"> @(Html.Infragistics() .Grid(Model.UserVms) .ID("igGrid") .Width("100%") .AutoGenerateColumns(false) .AutoCommit(true) .PrimaryKey("UserName") .UpdateUrl(Url.Action("UsersSaveData", "UsersManagement")) .AggregateTransactions(true) .Columns(column => { column.For(x => x.UserName).HeaderText("Username"); column.For(x => x.Email).HeaderText("Email");.... column.For(x => x.PostCode).HeaderText("Postcode"); column.For(x => x.Gender).HeaderText("Gender").DataType("number").FormatterFunction("formatGenderColumn"); column.Unbound("Delete").HeaderText("").Formula("getDeleteBtnTemplate").UpdateMode(UnboundValuesUpdateMode.Auto); }) .Features(f => { f.Paging() .PageSize(15) .ShowPageSizeDropDown(false); f.Updating().ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("UserName").Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.LengthRange(4))); cs.ColumnSetting().ColumnKey("Delete").ReadOnly(true);
cs.ColumnSetting() .ColumnKey("Gender") .EditorType(ColumnEditorType.Combo) .ComboEditorOptions(wrapper => wrapper .Mode(ComboMode.DropDown) .DataSource(Model.Genders) .ValueKey("Key") .TextKey("Value")); }); f.Updating() .EditMode(GridEditMode.Cell) .EnableAddRow(true) .EnableDeleteRow(false) .DeleteRowLabel("Delete"); }) .DataBind() .Render())</div>
When inspecting the generated jQuery from this, it seems to be setting everything as is in the following jsfiddle jQuery example - jsfiddle.net/.../
Here is the jQuery output - http://pastebin.com/RmvzqSkR
Hello Singh,
Thank you for contacting us.
You have declared the Updating feature twice and only the second definition is taken into account.
Please declare it only once.
The features declaration should look like this:
.Features(f => { f.Paging() .PageSize(15) .ShowPageSizeDropDown(false); f.Updating().ColumnSettings(cs => { cs.ColumnSetting().ColumnKey("UserName").Required(true).TextEditorOptions(o => o.ValidatorOptions(vo => vo.LengthRange(4))); cs.ColumnSetting().ColumnKey("Delete").ReadOnly(true);
cs.ColumnSetting() .ColumnKey("Gender").EditorType(ColumnEditorType.Combo) .ComboEditorOptions(wrapper => wrapper .Mode(ComboMode.DropDown) .DataSource(Model.Genders) .ValueKey("Key") .TextKey("Value")); }) .EditMode(GridEditMode.Cell) .EnableAddRow(true) .EnableDeleteRow(false) .DeleteRowLabel("Delete"); });
Please let me know if you need additional help.
That very nicely fixes my first issue where using the MVC helper instead of jQuery the editor for the Gender field was not coming up as a dropbox.
Although the jQuery version bug is obviously still there and with the latest jQuery version you are unable to select from a combo box in dropdown mode.
However, my issue is fixed, thank you very much.