This question is locked. New answers and comments are not allowed.
Hello;
I have a form and inside it I have a DropDownList. When I'll edit an object I must to set the value of a DropDownList, but, it's not working very well. The value is setted but it just is shown when I click in the DropDownList. I need to show the value when the edit form is shown, not when I click in the DropDownList.
This is my form and dropdownlist:
Controller Util (GetPerfis)
Any suggestions?
I also have another problem. I'm using a jquery plugin to validate this field (http://docs.jquery.com/Plugins/Validation#Validator). This DropDownList is required and that plugin is not validating this field correctly.
This is the way that I'm using to validate:
It is working for another fields, like input, but is not working for a DropDownList.
Why this is happening?
I have a form and inside it I have a DropDownList. When I'll edit an object I must to set the value of a DropDownList, but, it's not working very well. The value is setted but it just is shown when I click in the DropDownList. I need to show the value when the edit form is shown, not when I click in the DropDownList.
This is my form and dropdownlist:
@model ViewModel.GrupoViewModel<form id="FormIncluir" action="/Grupo/Incluir" method="post" class="form_validation_ttip"> @(Html.Telerik().DropDownList() .Name("perfil").HtmlAttributes(new { Name = "perfil", Style = "margin:4px;width:201px;float:left" }) .DataBinding(binding => binding.Ajax().Select("GetPerfis", "Util")) .Value(Model.perfil))</form>public JsonResult GetPerfis(){ List<string> lista = new List<string>(); lista.Add("Analista"); lista.Add("Gestor"); return new JsonResult { Data = new SelectList(lista) };}Any suggestions?
I also have another problem. I'm using a jquery plugin to validate this field (http://docs.jquery.com/Plugins/Validation#Validator). This DropDownList is required and that plugin is not validating this field correctly.
This is the way that I'm using to validate:
rules: { perfil: { required: true } },Why this is happening?