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

How to add font awesome icon in appointment subject in Radscheduler

2 Answers 180 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Qasim
Top achievements
Rank 1
Qasim asked on 26 May 2014, 06:12 AM


How to add font awesome icon in appointment subject without losing the existing (default) style.
My Radscheduler is binded with Dataset code is below.

--------------------------aspx------------------------------------------
<telerik:RadScheduler OnClientAppointmentClick="OnClientAppointmentClick" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" CustomAttributeNames="SiteId,UserId" ReadOnly="true" runat="server" ID="RadScheduler1" SelectedView="MonthView" OverflowBehavior="Auto">                    
                    </telerik:RadScheduler>
-------------------------aspx.cs---------------------------------------
RadScheduler1.DataSource = ds;//Dataset
RadScheduler1.DataKeyField = "ScheduleID";
RadScheduler1.DataStartField = "ScheduleDate";
RadScheduler1.DataEndField = "ScheduleDate";
RadScheduler1.DataSubjectField = "Name";// at this stage I want add awesome font if CustomAttributeNames    UserId is not null. this field also available in ds
RadScheduler1.DataBind();

protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
{
DataRowView row = (DataRowView)e.Appointment.DataItem;
e.Appointment.Attributes.Add("SiteId", row["SiteId"].ToString());
e.Appointment.Attributes.Add("UserId", row["UserId"].ToString());
}

2 Answers, 1 is accepted

Sort by
0
Qasim
Top achievements
Rank 1
answered on 26 May 2014, 06:33 AM
CORRECTION to above code....


How to add font awesome icon in appointment subject without losing the existing (default) style.
My Radscheduler is binded with Dataset code is below.

--------------------------aspx------------------------------------------
< telerik:RadScheduler OnClientAppointmentClick="OnClientAppointmentClick" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" CustomAttributeNames="SiteId,UserId" ReadOnly="true" runat="server" ID="RadScheduler1" SelectedView="MonthView" OverflowBehavior="Auto">                    
                    </telerik:RadScheduler>
-------------------------aspx.cs---------------------------------------
RadScheduler1.DataSource = ds;//Dataset
RadScheduler1.DataKeyField = "ScheduleID";
RadScheduler1.DataStartField = "ScheduleDate";
RadScheduler1.DataEndField = "ScheduleDate";
RadScheduler1.DataSubjectField = "Name";// at this stage I want add awesome font if CustomAttributeNames    UserId is not null. this field also available in ds
RadScheduler1.DataBind();

protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)
{
DataRowView row = (DataRowView)e.Appointment.DataItem;
e.Appointment.Attributes.Add("SiteId", row["SiteId"].ToString());
e.Appointment.Attributes.Add("UserId", row["UserId"].ToString());
if(!string.IsNullOrEmpty(row["UserId"].ToString()))
e.Appointment.Subject = "<i class='fa fa-user'></i>" + e.Appointment.Subject;
}
0
Boyan Dimitrov
Telerik team
answered on 28 May 2014, 08:23 PM
Hello,

Using the appointment templates would be possible solution if you want to add an icon or image in the appointment container. Here you can find a demo that demonstrates how to use the appointment templates in real scenario.

Regards,
Boyan Dimitrov
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
Qasim
Top achievements
Rank 1
Answers by
Qasim
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or