Hello,we recently ran into a problem with igCombo, and we are not sure how to deal with it.We want to use a multiselectable combobox dropdown with ticks defined like this:
@(Html.Infragistics() .ComboFor(model => model.Committees) .ID("SubTopicCommitteeCombo") .Width("150") .LoadOnDemandSettings(lods => lods.Enabled(true).PageSize(25)) .DataSourceUrl(Url.Action("GetComboCommittees")) .ValueKey("CommitteeID") .TextKey("FullTitle") .CompactData(true) .EnableClearButton(false) .MultiSelectionSettings(msw => msw.Enabled(true)) .MultiSelectionSettings(msw => msw.ShowCheckBoxes(true)) .DataBind() .Render() )
It all works fine, until we reload the page, submit or fetch any ticked data.Now the problem is basically:So far, everytime we reload the page and fetch data, no matter what we previously selected, the combobox dropdown has no items ticked.Therefore: How does the model property assigned to the combobox dropdown have to look like in C#, so the data is submitted and fetched correctly?
Thanks in advance.
Hello,
yes, everything is in order there and the combobox dropdown handles the correct list of items. But the problem lies somewhere else.I'll illustrate it in a picture attached to this post.
Before editing, the name is displayed as expected.But, while editing, the previous selection is seemingly unselected and replaced by an empty combobox dropdown entry field.
Now, our problem is: while editing, we want the selection to remain the same as before editing.How can we achieve this behaviour?
I tried to reproduce the grid behavior you described. It could happen if the server method returns an error. In your case it is called "GetComboContacts". Please open developer tools in the browser (by pressing F12) and do the following:
1. Check whether you have any errors in the console coming from the grid or the combo.
2. Go to network tab and check whether the method "GetComboContacts" returns any data.
3. Check whether the method "GetComboContacts" returns the data in the following format:
Looking forward to hearing from you.
Hello,Yes, thank you, that was very enlightening!Now, something else came up as well regarding comboboxes:In igGrids, we use those comboboxes as well, but they seem to behave differently and offer different options.
We define the Responsible column as follows:
.Columns(column => {column.For(x => x.ResponsibleID).HeaderText("Responsible").FormatterFunction("lookupContacts").Hidden(ViewBag.UserSettingsTopic.IsHidden("ResponsibleID"));}
.Features(feature => {feature.Selection().MultipleSelection(false).Mode(SelectionMode.Row).Activation(true).MouseDragSelect(false);feature.Updating().EnableAddRow(false).ColumnSettings(cs => {cs.ColumnSetting().ColumnKey("ResponsibleID").Required(true).EditorType(ColumnEditorType.Combo).ComboEditorOptions(co => co .DataSource(Url.Action("GetComboContacts")) .ValueKey("ContactID") .TextKey("FullTitle") .EnableClearButton(false) .CompactData(false));}} The problem is:When evoking the igGrid inline editing, the ResponsibleID combobox dropdown should have a value set based on the ValueKey/TextKey mapping, we expected.But instead, it just initializes the combobox dropdown with an empty field everytime the inline editing is evoked.
How can we enable the expected behaviour?
Thanks in advance, again.
Thank you for contacting us.
1. How to fetch preselected records correctly? - In order to fetch records which are preselected, you should use SelectedValues property. As written in the documentation "that option is supported only for currently available list of items. When load-on-demand or filtering is enabled, then attempt to select not loaded item will fail." Therefore you should load all the items.
2. How to submit selected/unselected records? - You can attach on "selectedChanged" client-side event and perform AJAX query to apply your change to the server.
Please review the following sample for the 2 changes:
Let me know if this helps you.