selectlistitem Questions

8

Solved

i have an asp.net-mvc webpage and i want to show a dropdown list that is based off an enum. I want to show the text of each enum item and the id being the int value that the enum is associated with...
Alanson asked 15/8, 2010 at 21:59

2

Solved

I'm having an issue where I'm creating a List<SelectListItem> with optgroups but instead of creating an optgroup per group of SelectListItem it's creating a new SelectListGroup per SelectList...
Explorer asked 25/6, 2018 at 19:45

4

Solved

I am using DropDownListFor to render a dropdown list in a view. Somehow the rendered list does not select the SelectListItem with Selected set to true. In the controller action: var selectList = ...

2

Solved

I am trying to build a Dropdownlist, but battling with the Html.DropDownList rendering. I have a class: public class AccountTransactionView { public IEnumerable<SelectListItem> Accounts { ...
Phillipp asked 28/1, 2011 at 22:25

1

Solved

I'm trying to unit test a function which returns a SelectList. How can I retrieve an item from the SelectList to verify that my model is being constructed correctly? mySelectList.Items.First().D...
Subsistent asked 24/8, 2011 at 15:49

2

Solved

I am trying to create a form in ASP.NET MVC2 RC 2 that is based on a calendar event object. The object has eventTypeId which is a System.Int32 that I need to populate with via a select list. The c...

2

Solved

When you have a domain object that needs to display as an interface control, like a drop down list, ifwdev suggested creating an extension method to add a .ToSelectList(). The originating object i...
Electrify asked 6/4, 2010 at 21:48

2

Solved

I've tried many different ways to pass the selected items to the multiselect list with no luck. Finally, I tried this, which I think should display all the items as selected and still nothing in th...
Rhombus asked 18/1, 2010 at 19:53
1

© 2022 - 2024 — McMap. All rights reserved.