AdvancedInsertTemplate and RadScheduler_AppointmentInsert

6 posts, 0 answers
  1. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 24 May 2012 Link to this post

    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
    <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
  2. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 24 May 2012 Link to this post

    I add one more thing...
    i know it's basic...
    let's say in advancedForm ascx I want to add a public property VisibleStart bound to a field of my datasource VisibleFrom
    VisibleStart='<%# Bind("VisibleFrom") %>'
    this is wrong
    so what do I have to do?
    Thank you again


    telerik:RadScheduler runat="server" ID="RadScheduler1"
                SelectedView="TimelineView"
                DayEndTime="23:59:59"
                DataSourceID="SqlDataSource1"
                DataKeyField="ID"
                DataSubjectField="Subject"
                DataStartField="StartDate"
                DataEndField="EndDate"
                DataRecurrenceField="RecurrenceRule"
                DataRecurrenceParentKeyField="RecurrenceParentID"
                DataDescriptionField="Description"
                DataReminderField="Reminder"
                AdvancedForm-EnableCustomAttributeEditing="true"
                CustomAttributeNames="VisibleStart"
    ........

    <
    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") %>'
                         VisibleStart='<%# Bind("VisibleFrom") %>'
                          />
                 </AdvancedInsertTemplate>
     
     
         <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:GM2ConnectionString %>"
            SelectCommand="SELECT [ID], [StartDate], [EndDate], [Subject], [Description], [Reminder], [RecurrenceRule], [RecurrenceParentID], [IDTimeLineResource], [VisibleFrom], [VisibleTo], [AvailableFrom], [AvailableTo] FROM [SCH_Appointements_0]" >
        </asp:SqlDataSource>
  3. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 24 May 2012 Link to this post

    one more

    for <telerik:RadSchedulerRecurrenceEditor runat="server" ID="AppointmentRecurrenceEditor" Culture="it-IT" />
    Culture does not seems to work
  4. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 28 May 2012 Link to this post

    It's quite urgent, some ideas?
  5. Plamen
    Admin
    Plamen avatar
    2969 posts

    Posted 28 May 2012 Link to this post

    Hi Jean-Marc,

     
    I am attaching a sample page where is implemented similar behavior. Please review the code and implement just replace the resources and the attribute with the once that you use in your project.

    As for the localisation properties you can use the localisation property of RadSchedulerRecurrenceEditor  and add the desired word for every item in Italian language as in this code below:

    <telerik:RadSchedulerRecurrenceEditor runat="server" ID="AppointmentRecurrenceEditor" Localization-Daily="New Word" />

    If you have any further urgent questions you can also submit a support ticket from your Telerik account. 

    Hope this will be helpful.
    Regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Jean-Marc
    Jean-Marc avatar
    93 posts
    Member since:
    Mar 2011

    Posted 29 May 2012 Link to this post

    alright, i solved
    for my third post (culture) Plamen Zdravkov's answer did work
    for my second post it was just a stupid writing error, a mistyped, forget it

    for my first post... I tried to build everything from the begginning and tried, successfully, to check resouce source separating cases of advancedForm and the standard one,
    I added a CustomAttributeNames="myResourceID" and then setup a mirror property in AdvancedForm.ascx.vb "myResourceID".
    Then managing both cases.
    Now it's seems solved.

Back to Top