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

Using only the Scheduler Recurrence as form template

5 Answers 163 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 03 Mar 2009, 06:22 PM
I have an existing app where a user can generate a recurring schedule with a form we made that pretty much looks just like the RadScheduler's Recurrence edit form.  It then previews what dates will be generated from the schedule and they can then save those dates only to the database.

What I would like to do, is replace our custom made form with RadScheduler's Recurrence edit form.  So I don't want to initially databind the RadScheduler to anything and I don't want to see the whole schedule part of it either.  All I want is the functionality of the recurrence edit and then be able to retrieve what they entered in server side.

Is this possible?

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Mar 2009, 04:41 PM
Hello Zach,

You can use the ShowAdvancedInsertForm() method to display the advanced insert form. Then using javascript, css and code-behind you can hide the unnecessary parts from the advanced form and show the recurrence panel. You still have to enter text for the subject to pass the built-in validation. In AppointmentInsert you can get the recurrence rule and work with it as shown in this help topic:
http://www.telerik.com/help/aspnet-ajax/schedule_serversideworkingwithrecurringappointments.html
 
Please, try the code below and let us know if this is what you need.

Overriding the rsAdvChkWrap class hides the all-day and recurring checkboxes in the basic panel.
 <style type="text/css">  
    .rsAdvChkWrap  
    {  
        visibility:hidden !important;  
    }  
    </style> 
</head> 
<body> 
    <form id="form1" runat="server">     
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager>    
    <script type="text/javascript">  
        function pageLoad() {  
            var recurrencePanel = document.getElementById("RadScheduler1_Form_RecurrencePanel");  
            if(recurrencePanel)  
                recurrencePanel.style.display = "block";  
        }  
    </script> 
    <telerik:RadScheduler ID="RadScheduler1"   
        runat="server" .../>          

protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            RadScheduler1.Style.Add("visibility""visible");  
            RadScheduler1.Height = Unit.Pixel(500);  
            RadScheduler1.ShowAdvancedInsertForm(DateTime.Now);  
        }  
    }  
    protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)  
    {  
        if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert)  
        {  
            //Hides the advanced panel:  
            Panel advancedPanel = e.Container.FindControl("AdvancedControlsPanel"as Panel;  
            advancedPanel.Style.Add("visibility""hidden");  
            advancedPanel.Height = Unit.Pixel(1);  
 
            //The all-day and recuring checkboxes are hidden by  
            //overriding the rsAdvChkWrap class.  
        }  
    }  
    protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)  
    {  
        //Here you have access to the RecurrenceRule with:  
        //e.Appointment.RecurrenceRule  
    }  
 
    protected void RadScheduler1_AppointmentCommand(object sender, Telerik.Web.UI.AppointmentCommandEventArgs e)  
    {  
        if ((e.CommandName == "Cancel") || (e.CommandName == "Insert"))  
        {  
            RadScheduler1.Style.Add("visibility""hidden");  
            RadScheduler1.Height = Unit.Pixel(1);  
        }  
    } 



Sincerely yours,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Zach
Top achievements
Rank 1
answered on 12 Mar 2009, 07:14 PM
I have not been able to get this to work.  Perhaps it is because I am not sure what you mean when you say "You still have to enter text for the subject to pass the built-in validation."
0
Peter
Telerik team
answered on 16 Mar 2009, 05:37 PM

I have attached the test page. Give it a try and let me know if this is what you need.


Kind regards,
Peter
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
S
Top achievements
Rank 1
answered on 17 Mar 2009, 06:36 PM
Zach,
Have you found a solution to using the Scheduler Recurrence as a form template?

tia!
0
Zach
Top achievements
Rank 1
answered on 17 Mar 2009, 07:18 PM
Not exactly.  One thing in the attached example that did not work for me was  the positioning of 

RadScheduler1.ShowAdvancedInsertForm(DateTime.Now)


I moved it from the page load to the LoadComplete, and then it worked for me.  I am still working off and on with this.  I need to hide much of the functionality so I only have the recurrence panel showing.  I have not yet accomplished this completely.  Zach is a busy man right now :)
Tags
Scheduler
Asked by
Zach
Top achievements
Rank 1
Answers by
Peter
Telerik team
Zach
Top achievements
Rank 1
S
Top achievements
Rank 1
Share this question
or