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.
Unfortunately, activation email could not send to your email. Please try again.

Error while creating combobox.

Thread ID:





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

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 04:36 AM

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.

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.