This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/
InplaceEditor.ascx.vb
81 lines (75 loc) · 5.11 KB
/
InplaceEditor.ascx.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'
'{************************************************************************************}
'{ }
'{ DO NOT MODIFY THIS FILE! }
'{ }
'{ It will be overwritten without prompting when a new version becomes }
'{ available. All your changes will be lost. }
'{ }
'{ This file contains the default template and is required for the form }
'{ rendering. Improper modifications may result in incorrect behavior of }
'{ the appointment form. }
'{ }
'{ In order to create and use your own custom template, perform the following }
'{ steps: }
'{ 1. Save a copy of this file with a different name in another location. }
'{ 2. Specify the file location as the }
'{ 'OptionsForms.AppointmentInplaceEditorFormTemplateUrl' }
'{ property of the ASPxScheduler control. }
'{ 3. If you need custom fields to be displayed and processed, you should }
'{ accomplish steps 4-9; otherwise, go to step 10. }
'{ 4. Create a class, derived from the }
'{ AppointmentInplaceEditorTemplateContainer, containing custom properties. }
'{ This class definition can be located within a class file in the App_Code }
'{ folder. }
'{ 5. Replace AppointmentInplaceEditorTemplateContainer references in the }
'{ template page with the name of the class you've created in step 4. }
'{ 6. Handle the AppointmentInplaceEditorFormShowing event to create an }
'{ instance of the template container class, defined in step 4, and specify }
'{ it as the destination container instead of the default one. }
'{ 7. Define a class, which inherits from the }
'{ DevExpress.Web.ASPxScheduler.Internal.AppointmentFormController. }
'{ This class provides data exchange between the form and the appointment. }
'{ You should override ApplyCustomFieldsValues() method of the base class. }
'{ 8. Define a class, which inherits from the }
'{ DevExpress.Web.ASPxScheduler.Internal.AppointmentFormSaveCallbackCommand. }
'{ This class creates an instance of the AppointmentFormController inheritor }
'{ (defined in step 7) via the CreateAppointmentFormController method and }
'{ overrides the AssignControllerValues method of the base class to collect }
'{ user data from the form's editors. }
'{ 9. Handle the BeforeExecuteCallbackCommand event. The event handler code }
'{ should create an instance of the class defined in step 8, and specify it }
'{ as the destination command instead of the default one. }
'{ 10. Modify the overall appearance of the page and its layout. }
'{ }
'{************************************************************************************}
'
Imports System
Imports DevExpress.Web.ASPxScheduler
Imports DevExpress.Web
Imports DevExpress.Web.Internal
Partial Public Class InplaceEditor
Inherits InplaceEditorBaseFormControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'PrepareChildControls();
memSubject.Focus()
End Sub
Public Overrides Sub DataBind()
MyBase.DataBind()
Dim container As AppointmentInplaceEditorTemplateContainer = CType(Parent, AppointmentInplaceEditorTemplateContainer)
btnCancel.Image.Assign(container.Control.Images.GetInplaceEditorCancelImage(Page))
btnSave.Image.Assign(container.Control.Images.GetInplaceEditorSaveImage(Page))
btnEditForm.Image.Assign(container.Control.Images.GetInplaceEditorEditFormImage(Page))
btnSave.ClientSideEvents.Click = container.SaveHandler
btnCancel.ClientSideEvents.Click = container.CancelHandler
btnEditForm.ClientSideEvents.Click = container.EditFormHandler
End Sub
Protected Overrides Function GetChildEditors() As ASPxEditBase()
Dim edits() As ASPxEditBase = { memSubject }
Return edits
End Function
Protected Overrides Function GetChildButtons() As ASPxButton()
Dim buttons() As ASPxButton = { btnSave, btnCancel, btnEditForm }
Return buttons
End Function
End Class