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.
Rehello,
I had an idea and it is convert a list to string (by using "join(',')) and I still get the first value of the igCombo. Then, I noticed something. When I am saving the object, igCombo("value") is gotten instead of igCombo("values") .
For example, I select two values : 2 and 3 => igCombo("value") returns 2 and igCombo("values") returns [2,3].
How get igCombo("values") instead of igCombo("value")??
Please, I need help, any idea or any advice.
PS: Thanks for your help, Petar.
Hey,
After many tests, I found a way to get and save an object. For example, I have several objects (I name it "Contact") and a Contact has a list of phone numbers.
What I did:
I am happy to find a solution even if it is not very neat.