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. Image for the cookie policy date
close icon

Dropdownlist how to show data to index 0 instead value empty

i have ejDropdownlist but i don't want to show value empty index 0


i want to show data to index 0 



1 Reply

GS Gobalakrishnan S Syncfusion Team February 10, 2015 12:21 PM UTC

Hi Fever,

Thanks for using syncfusion products,

Query: Dropdown list how to show data to index 0 instead value empty

We would like to let you know that we have provided a property called “selectedItemIndex” which is used to specify which item value to be displayed in the dropdown list. If you want to specify particular item index value to be displayed in the dropdown list, please use this property during dropdown initialization like as below.

@Html.EJ().DropDownList("bikeList").Datasource((IEnumerable<Bikes>)ViewBag.datasource).SelectedItemIndex(0).DropDownListFields(df => df.ID("bikeid").Text("text").Value("text"))

For your convenience we have prepared a sample .You can download the sample from the below location.

Sample Download Link:

http://www.syncfusion.com/downloads/support/directtrac/118190/MvcApplication71769366729.zip

You can refer the following common user guide for ASP.NET MVC to know more about getting started with our components. Under each components we have provided “Concepts and features” section which explains about the features of the particular component.

http://help.syncfusion.com/web

You can also refer the following class reference link for JavaScript, which showcases all the properties, methods and events supported by each component. Our ASP.NET MVC components are created as a wrapper for JavaScript components. So you can refer the following link to know about the list of api’s supported in ASP.NET MVC.

http://help.syncfusion.com/cr/js

Please let us know if you have further queries.

Regards,

Gobalakrishnan S



Loader.
Live Chat Icon For mobile
Up arrow icon