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

Rad Scheduler Month View

1 Answer 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 19 Aug 2008, 09:54 AM
When in Month or timeline view is it possible to display the time on each appointment like outlook does

ie 15:00 16:00 Meeting with Alex and is is possible to put a little icon before the times to denote the type of appointment for example telephone call, demonstrations, meeting etc. The icons being placed where I have put the £ % and * symbols below

£  09:00 10:00 Call alex
% 15:00 16:00 Meeting with Bank
* 17:00:17:30 Demo at suppliers

Thanks

Gary

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 19 Aug 2008, 04:00 PM
Hello Gary,

Yes, this is possible with templates. Please, try the following code:

aspx:
<AppointmentTemplate> 
            <asp:Literal ID="AppointmentType" runat="server" Text='<%# Eval("Type") %>'></asp:Literal> 
              
            (<asp:Literal ID="AppointmentStartTime" runat="server" Text='<%# Eval("Start", "{0:t}") %>'></asp:Literal> 
            -  
            <asp:Literal ID="AppoitmentEndTime" runat="server" Text='<%# Eval("End", "{0:t}") %>'></asp:Literal>)             
            <asp:Literal ID="AppointmentSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Literal> 
        </AppointmentTemplate> 

Where "Type" is a custom attribute.

code-behind:
public class AppTemplate : ITemplate  
    {  
        public void InstantiateIn(Control container)  
        {  
            Literal subject = new Literal();  
            subject.DataBinding += subject_DataBinding;  
            container.Controls.Add(subject);  
        }  
 
        private void subject_DataBinding(object sender, EventArgs e)  
        {  
            Literal subject = (Literal) sender;  
            IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;             
            string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));  
            subject.Text = strSubject;  
        }  
    }  
    protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)  
    {  
        if (e.Command != SchedulerNavigationCommand.SwitchToMonthView)  
        {  
            RadScheduler1.AppointmentTemplate = new AppTemplate();    
        }              
    } 

Code behind is used to revert the appointment appearance to just show text in views other than MonthView.


Kind regards,
Peter
the Telerik team

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