0
Devexpress MVC拡張で奇妙な問題があります。私はグリッドを作成し、行を追加、編集、削除するためにCommandColumnsを有効にしました。ASP.NET MVC - GridViewEditingMode.PopupEditFormが表示されない
@model IEnumerable
@{
var grid = Html.DevExpress().GridView(settings =>
{
settings.Name = "dxGridView";
settings.Width = Unit.Pixel(678);
settings.SettingsEditing.Mode = GridViewEditingMode.PopupEditForm;
settings.SettingsEditing.PopupEditFormModal = true;
settings.KeyFieldName = "ID";
settings.CallbackRouteValues = new {Controller = "Home", Action = "ContentPartial"};
settings.CommandColumn.Visible = true;
settings.CommandColumn.EditButton.Visible = true;
settings.CommandColumn.DeleteButton.Visible = true;
settings.CommandColumn.DeleteButton.Text = "Delete";
settings.CommandColumn.NewButton.Visible = true;
settings.CommandColumn.NewButton.Text = "New";
settings.SettingsEditing.AddNewRowRouteValues = new {Controller = "Home", Action = "AddPartial"};
settings.SettingsEditing.UpdateRowRouteValues = new {Controller = "Home", Action = "EditPartial"};
settings.SettingsEditing.DeleteRowRouteValues = new {Controller = "Home", Action = "DeletePartial"};
settings.SettingsBehavior.ConfirmDelete = true;
settings.SetEditFormTemplateContent(x =>
{
Html.DevExpress().Label(val => val.Text = "Afasdfsadfsadfsdafasfasdf").Render();
Html.DevExpress().Button(
btnSettings =>
{
btnSettings.Name = "btnUpdate";
btnSettings.ControlStyle.CssClass = "button";
btnSettings.Text = "Update";
btnSettings.ClientSideEvents.Click = "function(s, e){ dxGridView.UpdateEdit(); }";
}
)
.Render();
Html.DevExpress().Button(
btnSettings =>
{
btnSettings.Name = "btnCancel";
btnSettings.ControlStyle.CssClass = "button";
btnSettings.Text = "Cancel";
btnSettings.ClientSideEvents.Click = "function(s, e){ javascript:pcModalMode.Show(); }";
}
)
.Render();
});
}
@grid.Bind(Model).GetHtml();
私が見るように、編集フォームには簡単なコンテンツを設定します。問題は、 "New"または "Edit"ボタンをクリックした後にポップアップが表示されないことです。 settings.SettingsEditing.Mode = GridViewEditingMode.PopupEditForm; は機能しない唯一の設定です。インラインモードと他のモードは正常に動作しますが、ポップアップを開く必要があります。