This question is locked. New answers and comments are not allowed.
Hi,
I'm a newbie with Popup edit form. I did many search and succeed to hide some fields in edit mode, customize the form, etc. However, I'm not able to show a DropDownList in the popup window. When I add it, the popup form does not display correctly.
Here is the EditorTemplate for UniteAdministrative.ascx :
Here is the controller code:
Here is the column in Model:
Thank you
Steve
I'm a newbie with Popup edit form. I did many search and succeed to hide some fields in edit mode, customize the form, etc. However, I'm not able to show a DropDownList in the popup window. When I add it, the popup form does not display correctly.
Here is the EditorTemplate for UniteAdministrative.ascx :
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<
dynamic
>" %>
<%
var controlName = ViewData.TemplateInfo.GetFullHtmlFieldName(String.Empty);
Html.Telerik().DropDownList().Name(controlName).DataBinding(binding =>
{
binding.Ajax().Select("_FillUniteAdmDropDownList", "Members");
})
.Render();
%>
Here is the controller code:
[Authorize]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult _FillUniteAdmDropDownList(string text)
{
var unites = _container.GetUnitesAdmLight();
if (text.HasValue())
unites = unites.Where(u => u.Nom.StartsWith(text));
return new JsonResult { Data = new SelectList(unites.ToList(), "Pk", "Nom") };
}
Here is the column in Model:
[Required]
[DisplayName("Admin unit")]
[UIHint("UniteAdministrative")]
public int fk_Unite_UniteAdm {get;set;}
Thank you
Steve