-
Notifications
You must be signed in to change notification settings - Fork 1
/
HomeController.vb
46 lines (40 loc) · 2.08 KB
/
HomeController.vb
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
43
44
45
46
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Mvc
Imports DevExpress.Web.ASPxUploadControl
Imports DevExpress.Web.Mvc
Imports Sample.Models
Namespace Sample.Controllers
Public Class HomeController
Inherits Controller
Public Function Index() As ActionResult
Return View()
End Function
Public Function GridViewPartial() As ActionResult
Return PartialView(Helper.GetData())
End Function
Public Function GridViewBatchUpdate(ByVal updateValues As MVCxGridViewBatchUpdateValues(Of TestModel, Integer)) As ActionResult
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())
End Function
Public Function UploadControlUploadFile() As ActionResult
Dim visibleIndex = Convert.ToInt32(Request.Params("hf"))
UploadControlExtension.GetUploadedFiles("uc", Nothing, Function(s, e)
Dim name = e.UploadedFile.FileName
e.CallbackData = name
If Helper.Files.ContainsKey(visibleIndex) Then
Helper.Files(visibleIndex) = e.UploadedFile.FileBytes
Else
Helper.Files.Add(visibleIndex, e.UploadedFile.FileBytes)
End If
End Function)
Return Nothing
End Function
End Class
End Namespace