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
265
Ig Combo Multiselection
posted

Hi,

Need a help in Igcombo Multi selection ,

In the Below code we have enabled multi select option  for combobox , but we need to set value in jquery/JavaScript.

   @(Html.Infragistics().ComboFor(model => model.Project.ProjectId).

                                                    MultiSelectionSettings(setting => { setting.ShowCheckBoxes(false); setting.Enabled(true); })

                                                    .DataSource(Model.ProjectCodeList).TextKey("Text").ValueKey("Value").

                                                    Width("100%").Render())

  • 20255
    Verified Answer
    Offline posted

    Hello,

    In order to select items you can use methods index/value/select. Below you will find code example:

                // With 'index' method
                $("#singleSelectCombo").igCombo("index", 0);

                // With 'value' method
                $("#multiSelectCombo").igCombo("value", ["White", "Yellow"]);

                //With 'select' method
                $("#checkboxSelectCombo").igCombo("select",
                    $.makeArray(
                        $("#multiSelectCombo").igCombo("itemsFromIndex", 0).element,
                        $("#multiSelectCombo").igCombo("itemsFromIndex", 1).element
                    ), {}
                );

    Documentation:

    https://www.igniteui.com/help/api/2017.1/ui.igCombo#methods