Hello,
At the moment i have a scheduler inplemented in my application. I made it exactly as in the examples is described. The problem is at the moment, that when there are appointments on the overview, pointing to different timeslots is workign kinda laggy and slow. it takes a while before it lights up the timeslot of one hour where i have my mouse on it. I searched the Telerik forum, for performance problems and im already using the radscriptmanager as well the radstylesheetmanager.
My code is below:
And the code behind:
Any help is much appriciated.
Regards,
Corné
At the moment i have a scheduler inplemented in my application. I made it exactly as in the examples is described. The problem is at the moment, that when there are appointments on the overview, pointing to different timeslots is workign kinda laggy and slow. it takes a while before it lights up the timeslot of one hour where i have my mouse on it. I searched the Telerik forum, for performance problems and im already using the radscriptmanager as well the radstylesheetmanager.
My code is below:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucQuickPlan.ascx.cs"
Inherits="VEGAS_HPF.Hoofdmenu.Agenda.ucQuickPlan" %>
<%@ Register Src="AdvancedForm.ascx" TagName="AdvancedForm" TagPrefix="scheduler" %>
<
style
type
=
"text/css"
>
.RadScheduler .rsAptSubject
{
text-align: left;
padding: 4px 0 1px;
margin: 0 0 3px;
font-size: 12px;
font-weight: bold;
color: #369;
height: 17px;
border-bottom: 1px solid #99DEFD;
width: 100%;
}
.RadScheduler .rsAdvancedEdit .RadColorPicker label
{
text-align: left;
display: block;
padding: 0;
}
</
style
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
// Dictionary containing the advanced template client object
// for a given RadScheduler instance (the control ID is used as key).
var schedulerTemplates = {};
function schedulerFormCreated(scheduler, eventArgs) {
// Create a client-side object only for the advanced templates
var mode = eventArgs.get_mode();
if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
// Initialize the client-side object for the advanced form
var formElement = eventArgs.get_formElement();
var templateKey = scheduler.get_id() + "_" + mode;
var advancedTemplate = schedulerTemplates[templateKey];
if (!advancedTemplate) {
// Initialize the template for this RadScheduler instance
// and cache it in the schedulerTemplates dictionary
var schedulerElement = scheduler.get_element();
var isModal = scheduler.get_advancedFormSettings().modal;
advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
advancedTemplate.initialize();
schedulerTemplates[templateKey] = advancedTemplate;
// Remove the template object from the dictionary on dispose.
scheduler.add_disposing(function() {
schedulerTemplates[templateKey] = null;
});
}
// Are we using Web Service data binding?
if (!scheduler.get_webServiceSettings().get_isEmpty()) {
// Populate the form with the appointment data
var apt = eventArgs.get_appointment();
var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
advancedTemplate.populate(apt, isInsert);
}
}
}
//]]>
</
script
>
<
telerik:RadScheduler
runat
=
"server"
ID
=
"RadScheduler1"
Width
=
"750px"
OnDataBound
=
"RadScheduler1_DataBound"
OnAppointmentDataBound
=
"RadScheduler1_AppointmentDataBound"
OnClientFormCreated
=
"schedulerFormCreated"
EnableDescriptionField
=
"true"
AppointmentStyleMode
=
"Default"
OnDataBinding
=
"RadScheduler1_DataBinding"
ayStartTime
=
"08:00:00"
DayEndTime
=
"22:00:00"
WorkDayStartTime
=
"08:00:00"
WorkDayEndTime
=
"22:00:00"
FirstDayOfWeek
=
"Monday"
LastDayOfWeek
=
"Friday"
HoursPanelTimeFormat
=
"HH:mm"
Height
=
"100%"
ShowViewTabs
=
"false"
Skin
=
"Telerik"
StartInsertingInAdvancedForm
=
"true"
StartEditingInAdvancedForm
=
"true"
>
<
AdvancedForm
Modal
=
"false"
/>
<
AdvancedEditTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedEditForm1"
Mode
=
"Edit"
Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
UserID='<%# Bind("intPersoneelID") %>' RoomID='<%# Bind("intKamerID") %>' />
</
AdvancedEditTemplate
>
<
AdvancedInsertTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedInsertForm1"
Mode
=
"Insert"
Subject='<%# Bind("Subject") %>'
Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
UserID='<%# Bind("intPersoneelID") %>' RoomID='<%# Bind("intKamerID") %>' />
</
AdvancedInsertTemplate
>
<
TimelineView
UserSelectable
=
"false"
/>
<
TimeSlotContextMenuSettings
EnableDefault
=
"true"
/>
<
AppointmentContextMenuSettings
EnableDefault
=
"true"
/>
</
telerik:RadScheduler
>
And the code behind:
public
partial
class
ucQuickPlan : System.Web.UI.UserControl
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
//RadScheduler1.ResourceTypes.Add(new ResourceType("User"));
//RadScheduler1.Resources.Add(new Resource("User", "22", "Alex"));
//RadScheduler1.Resources.Add(new Resource("User", "24", "Bob"));
}
protected
void
RadScheduler1_DataBinding(
object
sender, EventArgs e)
{
string
strDateSelected = RadScheduler1.SelectedDate.ToShortDateString();
//RadScheduler1.DataSource = Agenda_cls.GetAgendaItems(intPersoneelID, strDateSelected);
RadScheduler1.DataKeyField =
"id"
;
RadScheduler1.DataStartField =
"afspraakdatum"
;
RadScheduler1.DataEndField =
"afspraakdatumEind"
;
RadScheduler1.DataSubjectField =
"afspraakopmerkingen"
;
//RadScheduler1.GroupBy = "adviseur_id";
RadScheduler1.GroupingDirection = GroupingDirection.Horizontal;
RadScheduler1.DataSource = cls_VEGAS_HPF.getDataset(
"exec sp_getAgendaItems"
,
"ConnWB"
);
RadScheduler1.ResourceTypes.Clear();
DataTable dt_Adviseurs = cls_VEGAS_HPF.getDataTable(
"Exec sp_HypGetAdviseursInDienst"
,
"ConnHPF"
);
ResourceType restype1 =
new
ResourceType(
"Adviseur"
);
restype1.DataSource = dt_Adviseurs;
restype1.KeyField =
"intPersoneelID"
;
restype1.TextField =
"strNaam"
;
restype1.ForeignKeyField =
"intPersoneelID"
;
RadScheduler1.ResourceTypes.Add(restype1);
DataTable dt_Kamers = cls_VEGAS_HPF.getDataTable(
"SELECT * FROM tblDLocatieKamer"
,
"ConnHPF"
);
ResourceType restype2 =
new
ResourceType(
"Kamer"
);
restype2.DataSource = dt_Kamers;
restype2.KeyField =
"intKamerID"
;
restype2.TextField =
"strKamerNaam"
;
restype2.ForeignKeyField =
"intKamerID"
;
RadScheduler1.ResourceTypes.Add(restype2);
RadScheduler1.GroupBy =
"Adviseur"
;
}
protected
void
RadScheduler1_DataBound(
object
sender, EventArgs e)
{
//RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = true;
//RadScheduler1.ResourceTypes.FindByName("Room").AllowMultipleValues = false;
}
protected
void
RadScheduler1_AppointmentDataBound(
object
sender, SchedulerEventArgs e)
{
string
colorAttribute = e.Appointment.Attributes[
"AppointmentColor"
];
if
(!
string
.IsNullOrEmpty(colorAttribute))
{
int
colorValue;
if
(
int
.TryParse(colorAttribute,
out
colorValue))
{
Color appointmentColor = Color.FromArgb(colorValue);
e.Appointment.BackColor = appointmentColor;
e.Appointment.BorderColor = Color.Black;
e.Appointment.BorderStyle = BorderStyle.Solid;
e.Appointment.BorderWidth = Unit.Pixel(1);
}
}
e.Appointment.ToolTip = e.Appointment.Subject +
": "
+ e.Appointment.Description;
}
}
Any help is much appriciated.
Regards,
Corné