Asp.net mvc GridView模式编辑表单中的DevExpress弹出控件

Asp.net mvc GridView模式编辑表单中的DevExpress弹出控件,asp.net-mvc,gridview,devexpress,Asp.net Mvc,Gridview,Devexpress,我在gridview的模态编辑表单中遇到了弹出控件的问题。 问题是:当我点击模态表单上下文区域时,弹出控件不会隐藏!它刚刚重新排序。 请先看然后读代码。 谢谢 这是我的密码: 型号: public class Student { public int Id { get; set; } public string Name { get; set; } public string Family { get; set; } public int Avg { get; s

我在gridview的模态编辑表单中遇到了弹出控件的问题。 问题是:当我点击模态表单上下文区域时,弹出控件不会隐藏!它刚刚重新排序。 请先看然后读代码。 谢谢

这是我的密码:

型号:

public class Student
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Family { get; set; }
    public int Avg { get; set; }
}  
控制器:

public class HomeController : Controller
{
    public ActionResult Index()
    {
            Session["Students"] = new List<Student>() 
                                        { 
                                            new Student { Id = 1, Name = "N1", Family = "f1", Avg = 1 } ,
                                            new Student { Id = 2, Name = "N2", Family = "f2", Avg = 2 } ,
                                            new Student { Id = 3, Name = "N3", Family = "f3", Avg = 3 } ,
                                            new Student { Id = 4, Name = "N4", Family = "f4", Avg = 4 } ,
                                        };
        return View(Session["Students"]);
    }

    public ActionResult PartialGridView(Student student)
    {
        return PartialView("Index", Session["Students"]);
    }
}  
看法

@model List<Test.Models.Student>

@Html.DevExpress().GridView(settings =>
{
  settings.Name = "GvStudent";

  settings.KeyFieldName = "Id";
  settings.CallbackRouteValues = new { Controller = "Home", Action = "PartialGridView" };
  settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Home", Action = "AddStudentPartialGridView" };
  settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Home", Action = "UpdateStudentPartialGridView" };
  settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Home", Action = "DeleteStudentPartialGridView" };

  settings.SettingsEditing.Mode = GridViewEditingMode.PopupEditForm;
  settings.SettingsPopup.EditForm.Modal = true;
  settings.SettingsPopup.EditForm.HorizontalAlign = PopupHorizontalAlign.WindowCenter;
  settings.SettingsPopup.EditForm.VerticalAlign = PopupVerticalAlign.WindowCenter;
  settings.SettingsPopup.EditForm.Width = 400;
  settings.SettingsPopup.EditForm.Height = 200;
  settings.SettingsText.PopupEditFormCaption = "Student";

  settings.CommandColumn.Visible = true;

  settings.CommandColumn.NewButton.Visible = true;
  settings.CommandColumn.EditButton.Visible = true;
  settings.CommandColumn.DeleteButton.Visible = true;

  settings.Columns.Add(Name =>
  {
      Name.FieldName = "Name";
  });

  settings.Columns.Add(Family =>
  {
      Family.FieldName = "Family";
  });

  settings.Columns.Add(Avg =>
  {
      Avg.FieldName = "Avg";
  });

  settings.SetEditFormTemplateContent(content =>
  {
      Html.DevExpress().Button(btnShow =>
      {
          btnShow.Name="btnShow";
          btnShow.ClientSideEvents.Click = "function(s, e){popupControl.ShowAtElement(document.getElementById(s.name));}";
      }).Render();
  });

}).Bind(Model).GetHtml()

@{
  @Html.DevExpress().PopupControl(settings =>
  {
    settings.Name = "popupControl";
    settings.CloseAction = CloseAction.OuterMouseClick;
    settings.PopupVerticalAlign = PopupVerticalAlign.Below;
    settings.PopupHorizontalAlign = PopupHorizontalAlign.LeftSides;
    settings.ShowHeader = false;
    settings.ShowFooter = false;
    settings.AllowDragging = false;
    settings.AutoUpdatePosition = true;
    settings.Width = 320;

    settings.SetContent(() =>
    {
        ViewContext.Writer.Write("hello world!");
    });
  }).GetHtml();
}