We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error while creating combobox.

Thread ID:





125223 Aug 1,2016 06:46 AM UTC Aug 2,2016 08:36 AM UTC ASP.NET MVC 1
Tags: DropDownList
Dhananjay Malkar
Asked On August 1, 2016 06:46 AM UTC

Hi ,
i having error when creating combobox.
The call is ambiguous between the following methods or properties: 'Syncfusion.JavaScript.DropDownListPropertiesBuilder.Datasource(System.Collections.IEnumerable)' and 'Syncfusion.JavaScript.DropDownListPropertiesBuilder.Datasource(System.Action<Syncfusion.JavaScript.DataSourceBuilder>)'

Mycode is:
 @Html.EJ().DropDownList("CityMaster").WatermarkText("Select CityMaster").AllowVirtualScrolling(true).VirtualScrollMode(VirtualScrollMode.Normal).DropDownListFields(f => f.Value("Code").Text("Name")).EnableAnimation(true).EnableIncrementalSearch(true).CaseSensitiveSearch(false).Width("200").Datasource(ViewBag.City)
Please need your help.
What i am doing wrong.???

Keerthana Rajendran [Syncfusion]
Replied On August 2, 2016 08:36 AM UTC

Hi Dhananjay,   
 Thank you for contacting Syncfusion support.   
 The issue might be due to conflict between the type of datasource referred, because ViewBag maintains the type of data. So we suggest you to do explicit conversion of data by using the below code in your sample   
@Html.EJ().DropDownList("CityMaster").AllowVirtualScrolling(true).DropDownListFields(f =>f.ID("id").Text("text")).VirtualScrollMode(VirtualScrollMode.Normal).Datasource((IEnumerable<city>)ViewBag.datasource).WatermarkText("Select CityMaster").EnableAnimation(true).EnableIncrementalSearch(true).CaseSensitiveSearch(false).Width("200")   

We have prepared a sample with your code snippet. Please check the below given sample    

Please let us know if any concern.   


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon