- Home
- Forum
- ASP.NET MVC
- No data in combobox?
No data in combobox?
Why my combobox is not showing any data?
First, I have an autocomplete like this
which is filled from the controller:
and bounded in the view:
@Html.EJ().Autocomplete("Ugovaratelji").Datasource((IEnumerable<Object>)ViewBag.dsUgovaratelji).AutocompleteFields(df => df.Text("PrezimeIme").Key("StrankaID")).Value(Model == null ? "" : Model.Stranka?.Prezime + " " + Model.Stranka?.Ime + " - " + Model.Stranka?.OIB).Width("100%").ShowRoundedCorner(true).ClientSideEvents(c => c.Select("onSelUgo"))
and it's working fine. But when I add a combobox which is bounded on the same list:
@Html.EJ().ComboBox("cboxUgo").Datasource((IEnumerable<Object>)ViewBag.dsUgovaratelji).ComboBoxFields(cf => cf.Text("StrankaID").Value("StrankaID")).Width("100%")

it remains empty when I click dropdown arrow:
Am I doing something wrong?
Thanks!
Bernard.
SIGN IN To post a reply.
9 Replies
KR
Keerthana Rajendran
Syncfusion Team
February 9, 2018 11:52 AM UTC
Hi Bernard,
Thank you for contacting Syncfusion Support.
We have checked the reported issue by binding the same dataSource to Autocomplete and ComboBox from controller similar to your code. But, we were unable to reproduce the issue at our end.
Please refer to the below code used in our sample
| public ActionResult Index() { NorthwindDataContext db = new NorthwindDataContext(); var ugo = (from s in db.Orders orderby s.CustomerID, s.OrderID select new { s.OrderID }); ViewBag.dsUgovaratelji = ugo.Take(10).ToList(); return View(); } |
| <h3>Autocomplete</h3> @Html.EJ().Autocomplete("Ugovaratelji").Datasource((IEnumerable<Object>)ViewBag.dsUgovaratelji).AutocompleteFields(df => df.Text("OrderID").Key("OrderID")).Width("100%").ShowRoundedCorner(true).ClientSideEvents(c => c.Select("onSelUgo")) <br /> <h3>ComboBox</h3> @Html.EJ().ComboBox("cboxUgo").Datasource((IEnumerable<Object>)ViewBag.dsUgovaratelji).ComboBoxFields(cf => cf.Text("OrderID").Value("OrderID")).Width("200px") |
Now the Autocomplete and ComboBox are rendered as shown below
We have attached a sample for your reference which can be downloaded from the below link
If the issue persists, kindly provide us additional details like video to showcase the issue along with product version and browser details. If possible, please modify the above sample to reproduce the issue so that we can proceed further.
Regards,
Keerthana.
BJ
Bernard Jurlina
February 10, 2018 10:50 PM UTC
Hi Keerthana,
and thanks for the sample. Anyway, it turns out that I don't get data in my combobox when I set UnobtrusiveJavaScriptEnabled in web.config to true, and load @Scripts.Render("~/Scripts/ej/ej.unobtrusive.min.js") in _Layout.cshtml.
This is in my <head>
@Styles.Render("~/Content/bootstrap.css")
@Styles.Render("~/Content/ej/web/default-theme/ej.web.all.min.css")
@Styles.Render("~/Content/ej/web/responsive-css/ejgrid.responsive.css")
@Styles.Render("~/Content/toastr.min.css")
@Styles.Render("~/Content/Site.css")
@Scripts.Render("~/Scripts/jquery-3.2.1.min.js")
@Scripts.Render("~/Scripts/jsrender.min.js")
@Scripts.Render("~/Scripts/ej/ej.web.all.min.js")
@Scripts.Render("~/Scripts/ej/ej.unobtrusive.min.js")
@Scripts.Render("~/Scripts/ej/i18n/ej.culture.hr-HR.min.js")
@Scripts.Render("~/Scripts/ej/l10n/ej.localetexts.hr-HR.min.js")
@Scripts.Render("~/Scripts/MicrosoftAjax.js")
@Scripts.Render("~/Scripts/MicrosoftMvcAjax.js")
@Scripts.Render("~/Scripts/toastr.min.js")
So, without unobtrusive, the combobox is working fine.
Regards,
Bernard.
KR
Keerthana Rajendran
Syncfusion Team
February 12, 2018 04:42 AM UTC
Hi Bernard,
“ComboBox is not rendered with unobtrusive mode” is a known issue and we have fixed this issue internally. This fix will be included in our upcoming Volume 1, 2018 release which will be rolled out by this month(February). We will let you know once it has been rolled out.
Regards,
Keerthana.
BJ
Bernard Jurlina
February 14, 2018 09:38 PM UTC
Thank You Keerthana for the information.
I'm looking forward for the next release.
Regards,
Bernard.
KR
Keerthana Rajendran
Syncfusion Team
February 15, 2018 05:46 AM UTC
Hi Bernard,
Most Welcome. We will update you once Volume 1, 2018 has been rolled out
Regards,
Keerthana.
BJ
Bernard Jurlina
August 29, 2018 10:01 PM UTC
Hi Keerthana!

You wrote to me on February 11:
“ComboBox is not rendered with unobtrusive mode” is a known issue and we have fixed this issue internally. This fix will be included in our upcoming Volume 1, 2018 release which will be rolled out by this month(February). We will let you know once it has been rolled out. "
Is this issue fixed?
I'm using version 16.2.0.41, and when I enable unobtrusive mode, my combobox is acting like this, when I want to select some value:
Combobx in the view is this:
@Html.LabelFor(model => model.SuradId, "Suradnik", htmlAttributes: new { @class = "control-label col-md-3" })
<div class="col-md-9">
@Html.EJ().ComboBoxFor(model => model.SuradId).Datasource((IEnumerable<Object>)ViewBag.dsSuradnici).ComboBoxFields(cf => cf.Text("PrezimeIme").Value("UserId")).Width("100%")
@Html.ValidationMessageFor(model => model.SuradId, "", new { @class = "text-danger" })
</div>
Thanks!
Bernard
BM
Balaji M
Syncfusion Team
August 30, 2018 12:39 PM UTC
Hi Bernard
We have included the bug fix in the Volume 1 – 2018 release and Also prepared the sample using 16.2.0.41 version and find it from below and we are unable to reproduce the console error in unobtrusive mode.
Let us know if you have any queries.
Regards,
M. Balaji
BJ
Bernard Jurlina
September 1, 2018 06:24 AM UTC
Hi M. Balaji.



When I change your example, like this:
Then it's not working:
Regards,
Bernard.
KV
Karthikeyan Viswanathan
Syncfusion Team
September 3, 2018 11:50 AM UTC
Hi Bernard,
We have checked your reported case and able to reproduced this issue at our end. We have logged a bug report regarding this issue and the fix will be included in our Volume 3 2018 release to be rolled out by the mid of September 2018.
Regards,
Karthikeyan V.
SIGN IN To post a reply.
- 9 Replies
- 4 Participants
-
BJ Bernard Jurlina
- Feb 8, 2018 02:35 PM UTC
- Sep 3, 2018 11:50 AM UTC