This is a migrated thread and some comments may be shown as answers.

Keep AdvancedForm open on update.

1 Answer 66 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Developer
Top achievements
Rank 1
Developer asked on 03 Nov 2014, 10:01 AM
Hi, 
My client's wishes that when they press save/update button in AdvanceForm it should not shut down the dialog.
Instead, they want a text to be shown that the item is saved. 

Is this possible when using AdvancedForm?

<asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">
            <div class="rsAdvButtonWrapper">
                <asp:LinkButton runat="server" ID="UpdateButton" CssClass="rsAdvEditSave">
                    <span><%= Owner.Localization.Save %></span>
                </asp:LinkButton>
                <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel"
                    CausesValidation="false">
                    <span><%= Owner.Localization.Cancel %></span>
                </asp:LinkButton>
            </div>
        </asp:Panel>

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 06 Nov 2014, 10:02 AM
Hi Dick,

If you want to persist the changes then you will have to close the advanced form and then show it explicitly:

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        function openForm() {
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            var appD = $get("hiddenField").value;
            Sys.Application.remove_load(openForm);
            var app = scheduler.get_appointments().findByID(appD);
            scheduler.showAdvancedEditForm(app);
        }
    </script>
    <asp:HiddenField runat="server" ID="hiddenField" />
 
    <telerik:RadScheduler ID="RadScheduler1" runat="server" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate">
    </telerik:RadScheduler>
</form>

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    RadScheduler1.Provider = new XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), true);
}
 
protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    ScriptManager.RegisterStartupScript(Page, GetType(), "formScript", "Sys.Application.add_load(openForm);", true);
    hiddenField.Value = e.Appointment.ID.ToString();
}

Other thing you may try is to display this Panel in RadWindow after the appointment is updated.

Regards,
Hristo Valyavicharski
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Developer
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or