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

Rebind/ Refresh RadScheduler on closing RadWindow

8 Answers 375 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Content and Code
Top achievements
Rank 1
Content and Code asked on 02 Mar 2012, 01:55 AM
Hi,

I have a custom edit form. I open it up by setting OnClientAppointmentEditing="OpenEditSchedulePopup".

In my page I have some dropdownlists which are used to filter the data in the RadSchedule. I use a RadAjaxManager so that when the dropdown selection is changed the RadSchedule is updated via Ajax.

I would like to get the same effect when the Custom Edit Popup is closed. I have noticed that when the standard edit form is closed it uses Ajax to rebind the RadScheduler. How do I get my custom Edit popup form to use ajax to update the radscheduler when it is closed?

The standard edit form is doing it so I am sure it is possible.

8 Answers, 1 is accepted

Sort by
0
Content and Code
Top achievements
Rank 1
answered on 02 Mar 2012, 04:40 PM
can someone please help with this I havent been able to get this to work.
0
Ivana
Telerik team
answered on 06 Mar 2012, 02:36 PM
Hello,

Have you considered using a custom advanced form? For more information you can refer to the following code library showing how to achieve a custom advanced form using various data sources: Customize the Advanced Form with the Advanced Template User Controls.

I hope this helps.

All the best,
Ivana
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.
0
Content and Code
Top achievements
Rank 1
answered on 07 Mar 2012, 10:51 AM
Hi Ivana,

Yes I have but it does not work in my scenario. My advanced form is extremely complex.

How are you refreshing the Schedule using your standard advanced forms? Can I not use the same method to refresh in my scenario?
0
Content and Code
Top achievements
Rank 1
answered on 08 Mar 2012, 01:40 PM
I really need some help with this. Can someone please help.
0
Content and Code
Top achievements
Rank 1
answered on 09 Mar 2012, 10:26 PM
Its been 8 days since I posted this question. Is anyone going to help with this??
0
Ivana
Telerik team
answered on 12 Mar 2012, 11:04 AM
Hello,

Take a look at the code implementation of the following online demo: http://demos.telerik.com/aspnet-ajax/scheduler/examples/raddock/defaultcs.aspx, it uses RadDock as an advanced insert / edit form which is wrapped in UpdatePanel. You could follow the same approach and see if this will help you.

If you still have troubles, it will be very useful if you could open a support ticket on this matter and send us a sample page of the scenario you are trying to achieve. In order to help you we need to know what exactly is your scenario and what templates you are using.

Regards,
Ivana
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.
0
Vimal
Top achievements
Rank 1
answered on 10 Apr 2012, 06:44 PM
I have similar problem, Scheduler doesn't get refreshed on radwindow closed although ajaxrequest trigerred.The record displayed when page manually refreshed. Here is my code:
ASPX:
-----------------------------------
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function refreshGrid(arg) {
                if (!arg) {
                     
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                } else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }
 
        </script>
         
    </telerik:RadScriptBlock>
 
<telerik:RadScriptManager ID="Scriptmanager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        Modal="true" AutoSize="true" Behaviors="Maximize,Close,Move,Pin">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Title="Add New Appoitment"
                VisibleStatusbar="false">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadScheduler runat="server" ID="RadScheduler1" AllowInsert="false" LastDayOfWeek="Friday"
        EnableDescriptionField="true" FirstDayOfWeek="Monday" DayStartTime="08:00:00"
        DayEndTime="18:00:00" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start"
        DataEndField="End" Height="100%" MinutesPerRow="15" TimeLabelRowSpan="4" OnTimeSlotContextMenuItemClicking="RadScheduler1_TimeSlotContextMenuItemClicking"
        OnAppointmentDelete="RadScheduler1_AppointmentDelete"
        Skin="Office2010Blue">
        <AdvancedForm Modal="true" />
        <WeekView HeaderDateFormat="d" />
        <DayView HeaderDateFormat="d" />
        <TimeSlotContextMenuSettings EnableDefault="false" />
        <AppointmentContextMenuSettings EnableDefault="false" />
        <TimeSlotContextMenus>
            <telerik:RadSchedulerContextMenu ID="Menu1" runat="server">
                <Items>
                    <telerik:RadMenuItem Text="My New Appointment" runat="server" Value="newAppointment">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadSchedulerContextMenu>
        </TimeSlotContextMenus>
    </telerik:RadScheduler>
 
 
Code Behind:
----------------------
SchDataContext db = new SchDataContext();
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindScheduler();
            int i = RadScheduler1.Appointments.Count;
        }
    }
    protected void RadScheduler1_TimeSlotContextMenuItemClicking(object sender, Telerik.Web.UI.TimeSlotContextMenuItemClickingEventArgs e)
    {       
        if (e.MenuItem.Text == "My New Appointment")
        {
            int i =RadScheduler1.Appointments.Count;
            string strtime = e.TimeSlot.Start.ToString("t");
            string endtime = e.TimeSlot.End.ToString("t");
            string str = "<script language='javascript'>function f(){radopen('AddAppointment.aspx?s="+strtime+"&e="+endtime+"','Dialog'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
            ClientScript.RegisterStartupScript(this.GetType(), "mykey", str);
        }
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            bindScheduler();
            int i =RadScheduler1.Appointments.Count;
        }
    }
    private void bindScheduler()
    {
        var res = from t in db.ReminderMsts
                  select t;
        RadScheduler1.DataSource = res;
        RadScheduler1.DataBind();
    }
 
 
Button Insert appointment code
------------------------------------------
protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["s"]) || !string.IsNullOrEmpty(Request.QueryString["e"]))
        {
            string start = Request.QueryString["s"].ToString();
            string end = Request.QueryString["e"].ToString();
 
            ReminderMst rm = new ReminderMst
            {
 
                Start = Convert.ToDateTime(start),
                End = Convert.ToDateTime(end),
                Subject = txtSubject.Text,
                Description = txtDescription.Text
            };
            db.ReminderMsts.InsertOnSubmit(rm);
            db.SubmitChanges();
            ClientScript.RegisterStartupScript(this.GetType(), "mykey", "CloseAndRebind();", true);
        }
    }





0
n/a
Top achievements
Rank 1
Veteran
answered on 17 Feb 2021, 04:53 PM
Vimal -- I know this is a late post, however, this works perfect!!!  Thx
Tags
Scheduler
Asked by
Content and Code
Top achievements
Rank 1
Answers by
Content and Code
Top achievements
Rank 1
Ivana
Telerik team
Vimal
Top achievements
Rank 1
n/a
Top achievements
Rank 1
Veteran
Share this question
or