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

A few Questions about RadScheduler

1 Answer 114 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 08 Nov 2008, 12:39 PM
Hi,
     I have a couple of questions regarding RadScheduler's AdvancedTemplates and resources.

1.)  How can I get or set a particular resource value through code-behind.? i.e. Whatever value I select in the form should be available on the server side plus whatever value I assign to a resource for a particular appointment that should be the selected value for that particular resource. (I'm assiging the datasource for the appointments and resources in code behind. )

2.)  Is it possible to not display the AllDayEvent Checkbox in the advancedTemplate without creating a user control of our own?

3.)  How can I show a resource's selected value in the appointment display area in different views.(Day,month,week,timeline) ?

4.)  Can we change the "Subject" Caption in the advancedtemplate ?

5.) how to add a timepicker control for time selection in adavncedtemplate (there is already a claendar by default so I'm assuming there must be an easy way to add a time picker control as well) and how can we make the date and time textboxes readonly in advancedtemplate (I want the datetime values to change only when the user selects a date and time through respective picker controls)?


I would really appreciate if someone can answer all the queries as soon as possible as I'm on a deadline.Please tell me the quickest and easiest way of doing all these tasks.

(Note : I cannot bind the controls to a datasource in desing -time)


Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 10 Nov 2008, 04:57 PM
Hello john,

Here are the answers to your questions, however they are strictly for version 2008.3 1105.

1. Could you please be more specific what exactly you need to implement? What you describe seems like what RadScheduler does by default - if you assign a resource to an appointment and you go in advanced mode, the assigned resource will appear as the selected item of the resource DropDownList control. If you need to preselect a specific resource when inserting a new appointment, you can try the following approach:

 protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
    {  
        if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)  
        {  
            DropDownList roomDdl = (DropDownList)e.Container.FindControl("ResRoom");  
            roomDdl.SelectedIndex = 1;  
          
        }  
    } 

RadScheduler renders a "Res" prefix to the name of the resource type, in this case Room.
   <ResourceTypes> 
            <telerik:ResourceType DataSourceID="AccessDataSource2" ForeignKeyField="RoomID" KeyField="ID" 
                Name="Room" TextField="RoomName" /> 
        </ResourceTypes> 

2. Please, try the following:

 protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
    {  
        if( (e.Container.Mode == SchedulerFormMode.AdvancedInsert)||(e.Container.Mode == SchedulerFormMode.AdvancedEdit))  
        {              
            CheckBox allDayCheckBox = (CheckBox)e.Container.FindControl("AllDayEvent");  
            allDayCheckBox.CssClass = "Hide";            
          
        }  
    } 

  .Hide  
  {  
     display:none !important;  
  } 

3. Please, see this kb article:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/creating-and-adding-an-appointment-template-dynamically-and-accessing-the-appointment-object-in-the-template-class.aspx

4. Yes, here is how:
 protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
    {  
        if( (e.Container.Mode == SchedulerFormMode.AdvancedInsert)||(e.Container.Mode == SchedulerFormMode.AdvancedEdit))  
        {  
           
            Panel basicConrolsPanel = (Panel)e.Container.FindControl("BasicControlsPanel");  
            WebControl subjectControl = (WebControl) basicConrolsPanel.Controls[0].Controls[0];  
            subjectControl.Controls.Clear();  
 
            Label subjectLabel = new Label();  
            subjectLabel.Text = "Custom subject description";  
            subjectControl.Controls.Add(subjectLabel);  
             
      }  
    } 

5. You can use the FormCreated event and add dynamically a control in a similar way as shown in question 4. Or, you can use the Customizing the Advanced Template example.


Good luck!

Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
john
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or