Hello everybody!
I succeed to insert the selected value of a combo, in a column of the igGrid.
Then, I want to insert several values at the same time (in one column of one row). The type of object of this column is List<int> (a list of ID)
How inserting several values?
Here a part of my code:
----------------------------------------------------------------------
@(Html.Infragistics().Grid<A_Form_Model>()
.ID("grid_FormA")
.PrimaryKey("IdLineA")
.RenderCheckboxes(true)
.AutoGenerateColumns(false)
.AutoGenerateLayouts(false)
.RestSettings(rest =>
rest.RestSetting()
.Create(c => c.RestVerbSetting().Url("/api/linea").Batch(true))
.Update(u => u.RestVerbSetting().Url("/api/linea"))
.Remove(r => r.RestVerbSetting().Url("/api/linea"))
)
.Columns(column =>
{
column.For(x => x.IdLineA).Hidden(true);
column.For(x => x.ReferenceAIEA).Width("80px");
column.For(x => x.ListProducts).Width("400px");//It is here I want to add several values
column.For(x => x.IdAddressFrenchParticipant).Width("80px").FormatterFunction("lookupAd");
})
.Features(features =>
features.Selection().Mode(SelectionMode.Cell).MultipleSelection(true);
features.RowSelectors().EnableCheckBoxes(false).EnableRowNumbering(true);
features.Updating().EditMode(GridEditMode.RowEditTemplate).EnableAddRow(true)
.ColumnSettings(settings =>
settings.ColumnSetting().ColumnKey("IdAddressFrenchParticipant").EditorType(ColumnEditorType.Combo)
.ComboEditorOptions(options => options.DataSource(ViewBag.Source).ValueKey("IdAddress").TextKey("AddressText"));
settings.ColumnSetting().ColumnKey("ListProducts").EditorType(ColumnEditorType.Combo)
.ComboEditorOptions(options => options.AllowCustomValue(true).MultiSelection(ComboMultiSelection.OnWithCheckboxes).DataSource(ViewBag.Cycles).ValueKey("IdProduct").TextKey("Label"));
});
.EnableHoverStyles(true)
.Height("500px")
.Width("100%")
.DataSourceUrl("/api/linea")
.LocalSchemaTransform(true)
.DataBind()
.Render()
------------------------------------------------------
What is missing?
Regards,
F2O
Hello F2O,
Please note that currently multiselection and custom values are not supported when used together in igCombo. A potential workaround for this issue can be seen in the documentation at:
http://help.infragistics.com/NetAdvantage/jQuery/2013.1/CLR4.0?page=igCombo_Known_Limitations.html
igGrid currently only supports single selection, therefore the combo selected values in this scenario would need to be manually handled in order to parse them into a list. A very similar scenario is described at:
http://ko.infragistics.com/community/forums/p/77205/390636.aspx
Hope this helps. Please do not hesitate to contact me if you have any questions.
Hello Petar,
Thanks for your response.
I followed the sample you indicated.
$(".select").on("igcomboselectionchanged", function (event, args) {$(".select").empty();for (var i = 0 ; i < args.items.length ; i++) {$(".select").append(args.items[i].value); }});
But I don't success to create a list for saving it. In fact, I have a object to edit, that contains a list of integers.
When I am saving, the modelState.IsValid is returned false.
Excuse me for the missing part of my previous response:
Moreover, the list of integers of the object is null.
How can I get the values?
Thanks,