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
2350
igCombo - 15.1 ComboFor does not set selected item
posted

Hello,

I’m using Razor syntax to create my igCombos.  In 13.2, I was able to use the following code to create a combo and select the initial item:

        @(Html.Infragistics().ComboFor(x => Model.QueryAggregate)

            .ID("QueryAggregate_" + Model.Id)

            .TextKey("Text").ValueKey("Value")

            .EnableClearButton(false)

            .DataSource(EnumHlpr.GetEnumSelectList(typeof(GroupBy)))

            .DataBind()

            .Render()

         )

This used to work well, and the combo selected the initial Model.QueryAggregate item.  I am finding that in 15.1, there is no initial item selected.  I am able to get around this by adding the following line:

            .ComboInitialSelectedItems(x => x.Settings.Add(new ComboInitialSelectedItemsSettings() { Value = (int)Model.QueryAggregate }))

This seems a little redundant because this used to work fine without setting the ComboInitialSelectedItems.  I would expect the igCombo control to work like it did in 13.2 and not be required to set ComboInitialSelectedItems when using ComboFor.

Thanks,

Paul