Do not select any dropdownlist value

Asked

Viewed 17 times

0

Hello I have the following dropdownlist:

@Html.DropDownListFor(m => @item4.Status, new List<SelectListItem>
                                     {                                      
                                   new SelectListItem { Text = "Sem malha", Value = "Sem malha"},
                                   new SelectListItem { Text = "No gabinete (dos moldes)", Value = "No gabinete (dos moldes)"},
                                   new SelectListItem { Text = "A testar corte", Value = "A testar corte"},
                                   new SelectListItem { Text = "A bordar", Value = "A bordar"},
                                   new SelectListItem { Text = "Para cortar", Value = "Para cortar"},
                                   new SelectListItem { Text = "Em corte", Value = "Em corte"},
                                   new SelectListItem { Text = "A estampar", Value = "A estampar"},
                                   new SelectListItem { Text = "Para colocar", Value = "Para colocar"},
                                   new SelectListItem { Text = "Em confeção", Value = "Em confeção"},
                                   new SelectListItem { Text = "Para aparar", Value = "Para aparar"},
                                   new SelectListItem { Text = "Para lavar", Value = "Para lavar"},
                                   new SelectListItem { Text = "Para tingir", Value = "Para tingir"},
                                   new SelectListItem { Text = "Para ferros", Value = "Para ferros"},
                                   new SelectListItem { Text = "Para arranjos", Value = "Para arranjos"},
                                   new SelectListItem { Text = "Para embalagem", Value = "Para embalagem"},
                                   new SelectListItem { Text = "Embalado", Value = "Embalado"},
                                   new SelectListItem { Text = "Para controle", Value = "Para controle"},
                                       }, @item4.Status, new { @class = "Status form-control form-control-sm font-weight-bold", disabled = true })

only when value is null in my table it always takes the first value. How can I fix this?

Values are being sent by a jquery.

img

Thank you,

1 answer

0

You can create an item on the first dropdownlist index only as a placeholder and put the disabled = disabled attribute on it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.