http://demos.telerik.com/aspnet-ajax/scheduler/examples/radtooltip/defaultcs.aspx
However I am unable to get the tooltip to pull in the data from the event item. Can someone fill me in on how that info is passed to the class? Maybe I have a spelling error or something.
It works if I hard code the text as such:
protected
override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StartingOn.Text =
"Start Date HERE"; //apt.Owner.UtcToDisplay(apt.Start).ToString();
FullText.Text =
"Description Here<br /><br /><br />"; //apt.Subject;
}
Otherwise I get a JS error.Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; BRI/1; .NET4.0C; .NET4.0E)
Timestamp: Tue, 22 Feb 2011 23:02:54 UTC
Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 4723
Char: 21
Code: 0
URI: http://localhost/calendar/ScriptResource.axd?d=PeJmTGtbo6emTCMAFGjoVIZNSw0D1j6wp348ikmvclZFjWaJlpExLMpCLhd9-V5RTYDkwGS4vY5sCHAddiMlIhhTtgF_xtflgwD7pz3oq-dsmru87Akfq0gE17iRhBAnYH6LVvCzb_t115UFLRqJSGUkW2V_nRmPubJqQpIByqJPzK9K0&t=5c2f384e
11 Answers, 1 is accepted
I can not see anything disturbing in the pasted code.
Could you please send me your project so I can inspect it and help you?
Thank you!
All the best,
Veronica Milcheva
the Telerik team
<%@ Page Language="C#" AutoEventWireup="true" Title="" MasterPageFile="~/subPageMaster.master"
CodeFile="calendar.aspx.cs" Inherits="Telerik.Web.Examples.Scheduler.RadToolTip.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ register src="appointmenttooltip.ascx" tagName="toolTip" TagPrefix="uc2" %>
<%@ Register Src="calendarDetails.ascx" TagName="eventDetails" TagPrefix="uc1" %>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder2"
runat
=
"Server"
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
function hideActiveToolTip() {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) {
tooltip.hide();
}
}
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
function beginRequestHandler(sender, args) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1) {
hideActiveToolTip();
}
}
function clientBeforeShow(sender, eventArgs) {
w = $telerik.$(window).width() / 2;
h = $telerik.$(window).height() / 2;
if ((sender._mouseX > w) && (sender._mouseY > h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
return;
}
if ((sender._mouseX < w) && (sender._mouseY > h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
return;
}
if ((sender._mouseX > w) && (sender._mouseY < h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
return;
}
sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
}
//]]>
</
script
>
<
div
class
=
"exampleContainer"
style
=
"width:800px;height:1000px"
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"UpdatePanel1"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
telerik:RadScheduler
runat
=
"server"
ID
=
"RadScheduler1"
Width
=
"750px"
height
=
"100%"
TimeZoneOffset
=
"03:00:00"
DayStartTime
=
"08:00:00"
DayEndTime
=
"18:00:00"
DataSourceID
=
"SqlDataSource1"
DataKeyField
=
"eventGuid"
DataSubjectField
=
"title"
DataStartField
=
"startDate"
DataEndField
=
"endDate"
DisplayDeleteConfirmation
=
"false"
SelectedView
=
"MonthView"
Readonly
=
"true"
>
<
AdvancedForm
Modal
=
"true"
/>
<
TimelineView
UserSelectable
=
"false"
/>
</
telerik:RadScheduler
>
<
telerik:RadToolTipManager
runat
=
"server"
ID
=
"RadToolTipManager1"
Width
=
"320"
Height
=
"210"
Animation
=
"None"
HideEvent
=
"LeaveToolTip"
Text
=
"Loading..."
RelativeTo
=
"Element"
OnAjaxUpdate
=
"RadToolTipManager1_AjaxUpdate"
OnClientBeforeShow
=
"clientBeforeShow"
EnableShadow
=
"true"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
div
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
SelectCommandType
=
"StoredProcedure"
SelectCommand
=
"sp_GetMinistryEvents"
DeleteCommandType
=
"StoredProcedure"
DeleteCommand
=
"sp_RemoveMinistryEvent"
UpdateCommandType
=
"StoredProcedure"
UpdateCommand
=
"sp_UpdateMinistryEvent"
InsertCommandType
=
"StoredProcedure"
InsertCommand
=
"sp_InsertMinistryEvent"
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"eventGuid"
/>
<
asp:Parameter
Name
=
"title"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"startDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"endDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"startTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"endTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfo"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfoUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"imageGuid"
/>
<
asp:Parameter
Name
=
"groupGuid"
/>
<
asp:Parameter
Name
=
"imageUrl"
Type
=
"String"
/>
</
UpdateParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"title"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"startDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"endDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"startTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"endTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfo"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfoUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"imageGuid"
/>
<
asp:Parameter
Name
=
"groupGuid"
/>
<
asp:Parameter
Name
=
"imageUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"isFeatured"
Type
=
"String"
/>
</
InsertParameters
>
<
DeleteParameters
>
<
asp:Parameter
Name
=
"eventGuid"
/>
</
DeleteParameters
>
</
asp:SqlDataSource
>
</
asp:Content
>
using System;
using System.Data;
using System.ComponentModel;
using System.Collections;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI.Calendar.View;
using Telerik.Web.UI;
using System.IO;
namespace Telerik.Web.Examples.Scheduler.RadToolTip
{
public partial class DefaultCS : Page
{
private string siteTitle
{
get { return (String)ViewState["siteName"]; }
set { ViewState["siteName"] = value; }
}
private string conn
{
get { return (String)ViewState["conn"]; }
set { ViewState["conn"] = value; }
}
private Guid ministryGuid
{
get { return (Guid)ViewState["ministryGuid"]; }
set { ViewState["ministryGuid"] = value; }
}
private Guid messageGuid
{
get { return (Guid)ViewState["messageGuid"]; }
set { ViewState["messageGuid"] = value; }
}
private Guid contentPageGuid
{
get { return (Guid)ViewState["contentPageGuid"]; }
set { ViewState["contentPageGuid"] = value; }
}
private DataSet ds
{
get { return (DataSet)ViewState["ds"]; }
set { ViewState["ds"] = value; }
}
private DataSet ds1
{
get { return (DataSet)ViewState["ds1"]; }
set { ViewState["ds1"] = value; }
}
Image _headerImage = null;
Image _footerImage = null;
private DataTable table;
private int DayOfMonth;
private string backgroundColor = String.Empty;
private string eventString = String.Empty;
private DateTime startDate;
private DateTime endDate;
protected void Page_Load(object sender, EventArgs e)
{
conn = System.Configuration.ConfigurationManager.AppSettings["conn"];
ministryGuid = new Guid(System.Configuration.ConfigurationManager.AppSettings["ministryGuid"]);
RadScheduler1.AppointmentCreated += RadScheduler1_AppointmentCreated;
RadScheduler1.DataBound += RadScheduler1_DataBound;
SqlDataSource1.ConnectionString = conn;
SqlDataSource1.SelectParameters.Clear();
SqlDataSource1.SelectParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.UpdateParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.InsertParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.DeleteParameters.Add("ministryGuid", ministryGuid.ToString());
if (!Page.IsPostBack)
{
}
}
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
{
if (e.Appointment.Visible && !IsAppointmentRegisteredForTooltip(e.Appointment))
{
string id = e.Appointment.ID.ToString();
foreach (string domElementID in e.Appointment.DomElements)
{
RadToolTipManager1.TargetControls.Add(domElementID, id, true);
}
}
}
private bool IsAppointmentRegisteredForTooltip(Appointment apt)
{
foreach (ToolTipTargetControl targetControl in RadToolTipManager1.TargetControls)
{
if (apt.DomElements.Contains(targetControl.TargetControlID))
{
return true;
}
}
return false;
}
protected void RadScheduler1_DataBound(object sender, EventArgs e)
{
RadToolTipManager1.TargetControls.Clear();
ScriptManager.RegisterStartupScript(this, typeof(Page), "HideToolTip", "hideActiveToolTip();", true);
}
protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
int aptId;
Appointment apt;
if (!int.TryParse(e.Value, out aptId))//The appoitnment is occurrence and FindByID expects a string
apt = RadScheduler1.Appointments.FindByID(e.Value);
else //The appointment is not occurrence and FindByID expects an int
apt = RadScheduler1.Appointments.FindByID(aptId);
AppointmentToolTip toolTip = (AppointmentToolTip)LoadControl("AppointmentToolTip.ascx");
toolTip.TargetAppointment = apt;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
}
}
}
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AppointmentToolTip.ascx.cs" Inherits="Telerik.Web.Examples.Scheduler.RadToolTip.AppointmentToolTip" %>
<
div
style
=
"margin:5px 5px 0px 5px; font-size:12px; padding-bottom: 10px;"
>
<
div
style
=
"border-bottom:solid 1px #ccc;margin-bottom:9px;font-size:11px;"
>Starting on: <
asp:Label
runat
=
"server"
ID
=
"StartingOn"
></
asp:Label
></
div
>
<
asp:Literal
runat
=
"server"
ID
=
"FullText"
></
asp:Literal
>
</
div
>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
namespace Telerik.Web.Examples.Scheduler.RadToolTip
{
public partial class AppointmentToolTip : UserControl
{
private Appointment apt;
public Appointment TargetAppointment
{
get
{
return apt;
}
set
{
apt = value;
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StartingOn.Text = "Start Date HERE"; //apt.Owner.UtcToDisplay(apt.Start).ToString();
FullText.Text = apt.Subject;
}
}
}
Unfortunately I can not run your project as I don't have your database.
Please take a look at the attached project that is similar to the demo. Please compare it with your code and let me know how it goes.
Best wishes,
Veronica Milcheva
the Telerik team
Thanks for the zip. I recopied everything from it.
I did have to remove the following
DataRecurrenceField="RecurrenceRule" --- DB does not support
DataRecurrenceParentKeyField="RecurrenceParentID" -- DB Does not support
//I received the following error
'Telerik.Web.UI.RadScheduler' does not have a public property named 'TimeSlotContextMenuSettings'
<TimeSlotContextMenuSettings EnableDefault="true" />
<AppointmentContextMenuSettings EnableDefault="true" />
My tooltip is still not working. This is the javascript Error that I receive:
Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 4723
Char: 21
Code: 0
URI: http://localhost/calendar/ScriptResource.axd?d=PeJmTGtbo6emTCMAFGjoVIZNSw0D1j6wp348ikmvclZFjWaJlpExLMpCLhd9-V5RTYDkwGS4vY5sCHAddiMlIhhTtgF_xtflgwD7pz3oq-dsmru87Akfq0gE17iRhBAnYH6LVvCzb_t115UFLRqJSGUkW2V_nRmPubJqQpIByqJPzK9K0&t=5c2f384e
If I change the following, it works - the apt object is not being accessed for some reason.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StartingOn.Text = "Start Date HERE"; //apt.Owner.UtcToDisplay(apt.Start).ToString();
FullText.Text = apt.Subject;
}
Thanks for your help!
Any assistance is much appreciated.
Could you please send me your project so I can inspect it and help you?
Thank you!
All the best,
Veronica Milcheva
the Telerik team
<%@ Page Language="C#" AutoEventWireup="true" Title="" MasterPageFile="~/subPageMaster.master"
CodeFile="calendar.aspx.cs" Inherits="Telerik.Web.Examples.Scheduler.RadToolTip.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ register src="appointmenttooltip.ascx" tagName="toolTip" TagPrefix="uc2" %>
<%@ Register Src="calendarDetails.ascx" TagName="eventDetails" TagPrefix="uc1" %>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder2"
runat
=
"Server"
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
function hideActiveToolTip() {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) {
tooltip.hide();
}
}
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
function beginRequestHandler(sender, args) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1) {
hideActiveToolTip();
}
}
function clientBeforeShow(sender, eventArgs) {
w = $telerik.$(window).width() / 2;
h = $telerik.$(window).height() / 2;
if ((sender._mouseX > w) && (sender._mouseY > h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
return;
}
if ((sender._mouseX < w) && (sender._mouseY > h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
return;
}
if ((sender._mouseX > w) && (sender._mouseY < h)) {
sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
return;
}
sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
}
//]]>
</
script
>
<
div
class
=
"exampleContainer"
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"UpdatePanel1"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
telerik:RadScheduler
runat
=
"server"
ID
=
"RadScheduler1"
Width
=
"750px"
TimeZoneOffset
=
"03:00:00"
SelectedDate
=
"2011-01-30"
DayStartTime
=
"08:00:00"
DayEndTime
=
"18:00:00"
DataSourceID
=
"SqlDataSource1"
DataKeyField
=
"eventGuid"
DataSubjectField
=
"title"
DataStartField
=
"startDate"
DataEndField
=
"endDate"
DisplayDeleteConfirmation
=
"false"
SelectedView
=
"MonthView"
Readonly
=
"true"
>
<
AdvancedForm
Modal
=
"true"
/>
<
TimelineView
UserSelectable
=
"false"
/>
</
telerik:RadScheduler
>
<
telerik:RadToolTipManager
runat
=
"server"
ID
=
"RadToolTipManager1"
Width
=
"320"
Height
=
"210"
Animation
=
"None"
HideEvent
=
"LeaveToolTip"
Text
=
"Loading..."
RelativeTo
=
"Element"
OnAjaxUpdate
=
"RadToolTipManager1_AjaxUpdate"
OnClientBeforeShow
=
"clientBeforeShow"
EnableShadow
=
"true"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
div
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
SelectCommandType
=
"StoredProcedure"
SelectCommand
=
"sp_GetMinistryEvents"
DeleteCommandType
=
"StoredProcedure"
DeleteCommand
=
"sp_RemoveMinistryEvent"
UpdateCommandType
=
"StoredProcedure"
UpdateCommand
=
"sp_UpdateMinistryEvent"
InsertCommandType
=
"StoredProcedure"
InsertCommand
=
"sp_InsertMinistryEvent"
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"eventGuid"
/>
<
asp:Parameter
Name
=
"title"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"startDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"endDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"startTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"endTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfo"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfoUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"imageGuid"
/>
<
asp:Parameter
Name
=
"groupGuid"
/>
<
asp:Parameter
Name
=
"imageUrl"
Type
=
"String"
/>
</
UpdateParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"title"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"startDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"endDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"startTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"endTime"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfo"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"moreInfoUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"imageGuid"
/>
<
asp:Parameter
Name
=
"groupGuid"
/>
<
asp:Parameter
Name
=
"imageUrl"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"isFeatured"
Type
=
"String"
/>
</
InsertParameters
>
<
DeleteParameters
>
<
asp:Parameter
Name
=
"eventGuid"
/>
</
DeleteParameters
>
</
asp:SqlDataSource
>
</
asp:Content
>
using System;
using System.Data;
using System.ComponentModel;
using System.Collections;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI.Calendar.View;
using Telerik.Web.UI;
using System.IO;
namespace Telerik.Web.Examples.Scheduler.RadToolTip
{
public partial class DefaultCS : Page
{
private string siteTitle
{
get { return (String)ViewState["siteName"]; }
set { ViewState["siteName"] = value; }
}
private string conn
{
get { return (String)ViewState["conn"]; }
set { ViewState["conn"] = value; }
}
private Guid ministryGuid
{
get { return (Guid)ViewState["ministryGuid"]; }
set { ViewState["ministryGuid"] = value; }
}
private Guid messageGuid
{
get { return (Guid)ViewState["messageGuid"]; }
set { ViewState["messageGuid"] = value; }
}
private Guid contentPageGuid
{
get { return (Guid)ViewState["contentPageGuid"]; }
set { ViewState["contentPageGuid"] = value; }
}
private DataSet ds
{
get { return (DataSet)ViewState["ds"]; }
set { ViewState["ds"] = value; }
}
private DataSet ds1
{
get { return (DataSet)ViewState["ds1"]; }
set { ViewState["ds1"] = value; }
}
Image _headerImage = null;
Image _footerImage = null;
private DataTable table;
private int DayOfMonth;
private string backgroundColor = String.Empty;
private string eventString = String.Empty;
private DateTime startDate;
private DateTime endDate;
protected void Page_Load(object sender, EventArgs e)
{
conn = System.Configuration.ConfigurationManager.AppSettings["conn"];
ministryGuid = new Guid(System.Configuration.ConfigurationManager.AppSettings["ministryGuid"]);
RadScheduler1.AppointmentCreated += RadScheduler1_AppointmentCreated;
RadScheduler1.DataBound += RadScheduler1_DataBound;
SqlDataSource1.ConnectionString = conn;
SqlDataSource1.SelectParameters.Clear();
SqlDataSource1.SelectParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.UpdateParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.InsertParameters.Add("ministryGuid", ministryGuid.ToString());
SqlDataSource1.DeleteParameters.Add("ministryGuid", ministryGuid.ToString());
if (!Page.IsPostBack)
{
}
}
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
{
if (e.Appointment.Visible && !IsAppointmentRegisteredForTooltip(e.Appointment))
{
string id = e.Appointment.ID.ToString();
foreach (string domElementID in e.Appointment.DomElements)
{
RadToolTipManager1.TargetControls.Add(domElementID, id, true);
}
}
}
private bool IsAppointmentRegisteredForTooltip(Appointment apt)
{
foreach (ToolTipTargetControl targetControl in RadToolTipManager1.TargetControls)
{
if (apt.DomElements.Contains(targetControl.TargetControlID))
{
return true;
}
}
return false;
}
protected void RadScheduler1_DataBound(object sender, EventArgs e)
{
RadToolTipManager1.TargetControls.Clear();
ScriptManager.RegisterStartupScript(this, typeof(Page), "HideToolTip", "hideActiveToolTip();", true);
}
protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
int aptId;
Appointment apt;
if (!int.TryParse(e.Value, out aptId))//The appoitnment is occurrence and FindByID expects a string
apt = RadScheduler1.Appointments.FindByID(e.Value);
else //The appointment is not occurrence and FindByID expects an int
apt = RadScheduler1.Appointments.FindByID(aptId);
AppointmentToolTip toolTip = (AppointmentToolTip)LoadControl("AppointmentToolTip.ascx");
toolTip.TargetAppointment = apt;
e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
}
}
}
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AppointmentToolTip.ascx.cs" Inherits="Telerik.Web.Examples.Scheduler.RadToolTip.AppointmentToolTip" %>
<
div
style
=
"margin:5px 5px 0px 5px; font-size:12px; padding-bottom: 10px;"
>
<
div
style
=
"border-bottom:solid 1px #ccc;margin-bottom:9px;font-size:11px;"
>Starting on: <
asp:Label
runat
=
"server"
ID
=
"StartingOn"
></
asp:Label
></
div
>
<
asp:Literal
runat
=
"server"
ID
=
"FullText"
></
asp:Literal
>
</
div
>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
namespace Telerik.Web.Examples.Scheduler.RadToolTip
{
public partial class AppointmentToolTip : UserControl
{
private Appointment apt;
public Appointment TargetAppointment
{
get
{
return apt;
}
set
{
apt = value;
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
StartingOn.Text = apt.Owner.UtcToDisplay(apt.Start).ToString();
FullText.Text = apt.Subject;
}
}
}
Hi Veronica,
I embedded my project again. It's the exact same code except for the the pieces I had to remove which ere
Please let me know how I may send you my complete project. The only way I can see is by submitting a ticket but I am unable to submit one.
DataRecurrenceField="RecurrenceRule" --- DB does not support
DataRecurrenceParentKeyField="RecurrenceParentID" -- DB Does not support
//I received the following error
'Telerik.Web.UI.RadScheduler' does not have a public property named 'TimeSlotContextMenuSettings'
<TimeSlotContextMenuSettings EnableDefault="true" />
<AppointmentContextMenuSettings EnableDefault="true" />
Could you please send me a runnable project so I can easily inspect it and help you.
Please note that as this is a Forum post - you are not allowed to attach .zip files. As an alternative please use one of the sites for free online storage as 4shared.com.
Thank you!
All the best,
Here is the link
http://my.pogoplug.com/album.html?sharetoken=0iKfKUV3Cl4-VD58G8eEd6lbxjpZl19_AAABLocs3sFRaU1wQUZZWXdXT3pfUVIxQ0h2dVJnKwXMEouN9-qSlQXSXeSU_qdMh8s&expiry=13&canlogin=1&locale=
Is there something that I is missing in the attached files? When I opened your example - I got an error
The ConnectionString property has not been initialized.
There is no connectionString in the attached web.config file and no database attached.
Could you please send me the database file?
Kind regards,
Veronica Milcheva
the Telerik team