I'm using AdvancedForm as example shown here
i'm not able to see the returning Category (it is a resource) from the AdvancedForm
What am I doing wrong?
Here i post the important parts
main.aspx
main.vb
(
AdvancedFormVB.ascx
AdvancedFormVB.ascx.vb
ResourceControlVB.ascx.vb
Thank you
i'm not able to see the returning Category (it is a resource) from the AdvancedForm
What am I doing wrong?
Here i post the important parts
main.aspx
<
AdvancedEditTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedEditForm1"
Mode
=
"Edit"
Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
CategoriaID='<%# Bind("IDTimeLineResource") %>'
/>
</
AdvancedEditTemplate
>
<
AdvancedInsertTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedInsertForm1"
Mode
=
"Insert"
Subject='<%# Bind("Subject") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
Description='<%# Bind("Description") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
CategoriaID='<%# Bind("IDTimeLineResource") %>'
/>
</
AdvancedInsertTemplate
>
main.vb
(
e.Appointment.Resources.Count
is 0)Protected Sub RadScheduler1_AppointmentInsert(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentInsertEventArgs) Handles RadScheduler1.AppointmentInsert
LogManager.WriteToDebugLog("c:\log\", "RadScheduler1_AppointmentInsert " & e.Appointment.Resources.Count)
If e.Appointment.Resources.Count > 0 Then
If e.Appointment.Resources.GetResourceByType("Categoria") IsNot Nothing Then
Dim myCategory As Long = Convert.ToInt32(e.Appointment.Resources.GetResourceByType("Categoria").Key)
Dim myScheduler As New Adept.CScheduler(myConn)
Dim newID As Long = myScheduler.NewAppointment(e.Appointment.Start, e.Appointment.End, e.Appointment.Subject, e.Appointment.Start, e.Appointment.End, e.Appointment.Start, e.Appointment.End, e.Appointment.Description, , , , myCategory)
myScheduler = Nothing
End If
End If
End Sub
AdvancedFormVB.ascx
<
asp:Panel
runat
=
"server"
ID
=
"ResourceControls"
>
<%-- RESOURCE CONTROLS --%>
<
ul
class
=
"rsResourceControls"
>
<
li
>
<!-- Resource controls should follow the convention Res[Resource Name] for ID -->
<
scheduler:ResourceControl
runat
=
"server"
ID
=
"ResCategoriaID"
Type
=
"Categoria"
Label
=
"Categoria:"
Skin='<%# Owner.Skin %>' />
</
li
>
</
ul
>
</
asp:Panel
>
AdvancedFormVB.ascx.vb
<
Bindable
(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property CategoriaID() As Object
Get
'IT DOES gET THE RIGHT CATEGORY. IT WORKS!
'LogManager.WriteToDebugLog("c:\log\", "GET BindableSupport CategoriaID " & ResCategoriaID.Value)
Return ResCategoriaID.Value
End Get
Set(ByVal value As Object)
ResCategoriaID.Value = value
'IT DOES SET THE RIGHT CATEGORY. IT WORKS!
'LogManager.WriteToDebugLog("c:\log\", "SET BindableSupport CategoriaID " & value)
End Set
End Property
ResourceControlVB.ascx.vb
<
Bindable
(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property Value() As Object
Get
If ResourceValue.SelectedValue <> "NULL" Then
'LogManager.WriteToDebugLog("c:\log\", "Value " & DeserializeResourceKey(ResourceValue.SelectedValue))
Return DeserializeResourceKey(ResourceValue.SelectedValue)
'IT WORKS!
End If
Return ""
End Get
Set(ByVal value As Object)
End Set
End Property
Thank you