Advanced Form... Accessing Modified TextBox values

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    1 posts
    Member since:
    Dec 2014

    Posted 05 Feb Link to this post

    Hi,
    I'm trying to do a custom save when using the Advanced Form in the RadScheduler and I'm having a problem obtaining the modified values.  I'm able to drag and drop appointments from a grid but I cannot access the modified values in the Advanced Form.

    What I'm experiencing is that the 'Form Created' method is called when initially opening an appointment and when the SAVE or the CANCEL buttons are clicked. Should this occur when the SAVE button is clicked? 

    protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)
    {

    RadTextBox txtDepartment = (RadTextBox)e.Container.Controls[1].FindControl("txtDepartment");
    string deptText = e.Appointment.Attributes["txtDepartment"];

    }

    When the 'RadScheduler1_FormCreated' is called I am not able to get the modified Text Box values.  I can only access the values originally loaded into the Advanced Form.  Is there a configuration issue?  How do I access teh modified values?

    Here is my code:

    <telerik:RadScheduler ID="RadScheduler1" runat="server" Height="100%" MinutesPerRow="15" ReadOnly="false" RowHeight="23px" StartInsertingInAdvancedForm="true"
    DataEndField="END_TIME" DataStartField="STARTDATE" DataDescriptionField="Description" DataSubjectField="AppointmentText" OnNavigationComplete="RadScheduler1_NavigationComplete"
    DataKeyField="Build_AppointmentTypeId" EnableDatePicker="true" OnNavigationCommand="RadScheduler1_NavigationCommand"
    OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
    OnDataBound="RadScheduler1_DataBound" Skin="Metro" OnAppointmentCommand="RadScheduler1_AppointmentCommand"  EnableAdvancedForm="true" EnableDescriptionField="true"
    OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnFormCreated="RadScheduler1_FormCreated"
    OverflowBehavior="Auto" OnClientFormCreated="OnClientFormCreated" OnAppointmentDelete="RadScheduler1_AppointmentDelete" Enabled="true"
    CustomAttributeNames="Due, Priority, AppointmentColor, User, RecurrenceRule, Reminder, Room, TimeZoneID, Department, AppointmentType, Quantity, ServiceQuantity, LastModifiedBy, LastModifiedDate, CreatedDate, CreatedBy">

    <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
    <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>

    <AdvancedForm Modal="true"></AdvancedForm>
    <Reminders Enabled="true" MaxAge="2" />

    <AppointmentTemplate>

    <div class="rsAptSubject">
    <%# Container.Appointment.Subject %>
    <p></p>
    <%# Eval("Description") %>
    <p></p>
    <%# Eval("Department") %>
    </div>

                   

    </AppointmentTemplate>
    <AdvancedEditTemplate>
    <scheduler:AdvancedForm ViewStateMode="Enabled"  runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' Department='<%# Bind("Department") %>' AppointmentType='<%# Bind("AppointmentType") %>'
    Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
    AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' Quantity='<%# Bind("Quantity") %>' ServiceQuantity='<%# Bind("ServiceQuantity") %>'
    LastModifiedBy='<%# Bind("LastModifiedBy") %>' CreatedBy='<%# Bind("CreatedBy") %>'
    LastModifiedDate='<%# Bind("LastModifiedDate") %>' CreatedDate='<%# Bind("CreatedDate") %>'
    RoomID='<%# Bind("Room") %>' TimeZoneID='<%# Bind("TimeZoneID") %>' />
    </AdvancedEditTemplate>

    <AdvancedInsertTemplate>
    <scheduler:AdvancedForm ViewStateMode="Enabled" runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>'
    Department='<%# Bind("Department") %>' AppointmentType='<%# Bind("AppointmentType") %>' 
    Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
    LastModifiedBy='<%# Bind("LastModifiedBy") %>' CreatedBy='<%# Bind("CreatedBy") %>'
    LastModifiedDate='<%# Bind("LastModifiedDate") %>' CreatedDate='<%# Bind("CreatedDate") %>'
    AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' Quantity='<%# Bind("Quantity") %>' ServiceQuantity='<%# Bind("ServiceQuantity") %>'
    RoomID='<%# Bind("Room") %>' TimeZoneID='<%# Bind("TimeZoneID") %>' />
    </AdvancedInsertTemplate>

    <TimelineView UserSelectable="false"  />

    <TimeSlotContextMenuSettings EnableDefault="true"  />

    <AppointmentContextMenuSettings EnableDefault="true" />
    <ResourceTypes>

    <telerik:ResourceType KeyField="ColorSequenceId" Name="ColorSequenceId" TextField="ColorSequenceId" ForeignKeyField="ColorSequenceId"></telerik:ResourceType>

    </ResourceTypes>

    </telerik:RadScheduler>

     

     

    Thank you,
    Jeff-

  2. Plamen
    Admin
    Plamen avatar
    2733 posts

    Posted 10 Feb Link to this post

    Hello,

    In cases when the modified value of the updated appointment is used we recommend using the AppointmentUpdate event and use the e.ModifiedAppointment  to get the updated values.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top