-
Notifications
You must be signed in to change notification settings - Fork 1
/
HomeController.cs
42 lines (37 loc) · 1.5 KB
/
HomeController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DevExpress.Web;
using DevExpress.Web.Mvc;
using Sample.Models;
namespace Sample.Controllers {
public class HomeController : Controller {
public ActionResult Index() {
return View();
}
public ActionResult GridViewPartial() {
return PartialView(Helper.GetData());
}
public ActionResult GridViewBatchUpdate(MVCxGridViewBatchUpdateValues<TestModel, int> updateValues) {
throw new Exception("Online data modification is not supported. Download the example and implement your logic in the GridViewBatchUpdate action method.");
//update the datasource here using the uploaded files
//clear the dictionary after
Helper.Files.Clear();
return PartialView("BatchEditingPartial", Helper.GetData());
}
public ActionResult UploadControlUploadFile() {
var visibleIndex = Convert.ToInt32(Request.Params["hf"]);
UploadControlExtension.GetUploadedFiles("uc", null, (s,e) => {
var name = e.UploadedFile.FileName;
e.CallbackData = name;
if (Helper.Files.ContainsKey(visibleIndex))
Helper.Files[visibleIndex] = e.UploadedFile.FileBytes;
else
Helper.Files.Add(visibleIndex, e.UploadedFile.FileBytes);
});
return null;
}
}
}