私は剣道UIグリッドを持っており、CSVにエクスポートするときにグリッドに表示されているのと同じフィルタリングを行うことができるように、エクスポートボタンが必要です。
投稿が KendoGridRequest を受け入れるようにしたいと思います
[HttpPost]
public JsonResult Grid(KendoGridRequest request)
{
var employees = GetEmployees();
var grid = new KendoGrid<Employee>(request, employees);
return Json(grid);
}
投稿で同じフィルターを使用するエクスポートボタンを追加して、エクスポートアクションも KendoGridRequest を受け入れ、CSV ファイルを返すようにしたいと考えています。
[HttpPost]
public ActionResult Export(KendoGridRequest request)
{
var employees = GetEmployees();
var grid = new KendoGrid<Employee>(request, employees);
return ToCsv(grid);
}
KendoGridRequest クラスはKendoGridBinderプロジェクトから来ています