1
マイコントローラー:変更DevExpress社の輸出行の値
public ActionResult ExportTo(ExportFormat exportFormat = ExportFormat.Xlsx)
{
ExportType exportType = GridViewHelper.ExportTypes.SingleOrDefault(x => x.Format == exportFormat);
if (exportType != null)
{
var modelList= modelRepository.GetAll();
var gridviewSettings = CreateExportGridViewSettings();
if(gridviewSettings != null)
return exportType.Method(gridviewSettings, modelList);
}
return RedirectToAction("Index");
}
...
private GridViewSettings CreateExportGridViewSettings()
{
var settings = new GridViewSettings
{
Name = "Export",
CallbackRouteValues = new {Controller = "MyController", Action = "List"},
Width = Unit.Percentage(100)
};
settings.Columns.Add("Id", Resources.Id);
!!! ---- !!!
...
}
! ---- !!! < - ここでは列を追加します。値がTrueの場合、この列の行出力はYESでなければならず、値がFalseの場合NOでなければなりません。