I'm trying to show appointments in TimeLineView grouped by resources. For each appointment in RadScheduler, I want to display dynamic tooltip. For that I had used RadToolTipManager and OnAjaxUpdate.
Code Snippet -
I am seeking answer to why part in code comment. If it work one way, then it must work another way. Did anyone else noticed this bug?
I believe that the commented part is more optimized and fast in comparison to method I had implemented. So can Telerik team confirm that code I'm using would be equivalent fast?
Code Snippet -
protected
void
RadToolTipManager1_AjaxUpdate(
object
sender, ToolTipUpdateEventArgs e)
{
// THIS WORKS SUCCESSFULLY
Appointment appointment =
null
;
foreach
(var apt
in
EventScheduler.Appointments.Where(apt => apt.ID.ToString().Equals(e.Value)))
{
appointment = apt;
break
;
}
// CODE COMMENTED BELOW NOT WORKS. WHY?
//int aptId;
//var appointment = int.TryParse(e.Value, out aptId) ? EventScheduler.Appointments.FindByID(aptId) : EventScheduler.Appointments.FindByID(e.Value);
if
(appointment ==
null
)
return
;
var toolTip = (AppointmentToolTip)LoadControl(
"UserControl/AppointmentToolTip.ascx"
);
toolTip.TargetAppointment = appointment;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
}
I am seeking answer to why part in code comment. If it work one way, then it must work another way. Did anyone else noticed this bug?
I believe that the commented part is more optimized and fast in comparison to method I had implemented. So can Telerik team confirm that code I'm using would be equivalent fast?