Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145049 | Jun 4,2019 09:15 AM UTC | Jun 7,2019 06:08 AM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: Dropdown List |
Value | Text |
1 | Red |
10 | Blue |
21 | Green |
43 | Purple |
For testing, if I set the index property it selects an item, but it's not the correct one, because index starts from 0 to collection.count - 1, while the value passed to the template is the value of the selected item (1, 10, 21 or 43).
So, how can I set and display the default value when the view is loaded?
Thanks, Marco
<ejs-dropdownlist id="@ViewData.ModelExplorer.Metadata.PropertyName" allowFiltering="true" dataSource="@ViewData[collectionName]" value="@Model.Value">
<e-dropdownlist-fields text="Text" value="Value" />
</ejs-dropdownlist>
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.