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

Adding an appointment to tooltip manager

2 Answers 112 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 02 Mar 2009, 06:49 AM
I don't understand why this isn't working......

 

 

 

protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

 

    Appointment appt = e.Appointment;

 

 

    appt.ToolTip = appt.ID.ToString();

 

 

    RadToolTipManager1.TargetControls.Add(appt.ID.ToString());

 

}

 

 

 


I keep getting this:

[NullReferenceException: Cannot find a server control with ID=2. If you need to specify a client-side element ID, please set IsClientID to true.]
   Telerik.Web.UI.RadToolTipBase.ThrowControlNotFound(String ctrlID) +61 blah blah blah blah blah

I thought I'm supposed to feed RadToolTipManager1.TargetControls.Add the control's ID. I'm guessing that this is not the Appointment ID? How do I grab this?

Sorry for two beginning ASP.NET questions today. This and the other small problem I posted about have me stuck, running in circles. Any assistance would be great.

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 03 Mar 2009, 12:12 AM
Blew a few more hours tinkering with this and reading every single thing I could find on ToolTipManager.

I could really use some help.

A few more pieces of information:
  1. I cannot seem to be able to grab the clientID of RadSchedule appointments. (See below)
  2. The Appointment's ID field does not work with ToolTipManager's TargetControls method. (See below).

Examples:

 

protected

void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

 

e.Appointment.ToolTip = e.Appointment.ID.ToString();

 

 

DataRowView row = (DataRowView)e.Appointment.DataItem;

 

 

string subject = row["EODSubject"].ToString();

 

 

string apptID = e.Appointment.ID.ToString();

 

 

string clientID = e.Appointment.ClientID;

 

 

lblDebug.Text += "xx - " + apptID + " - " + clientID + " - " + subject + " xx<br />";

 

 

}

 

The above code outputs this onto my page:

xx - 2 - - MCCS TV Launch Edit xx
xx - 3 - - TGIF xx
xx - 3_0 - - TGIF xx
xx - 3_1 - - TGIF xx
xx - 3_2 - - TGIF xx
xx - 3_3 - - TGIF xx
xx - 3_4 - - TGIF xx
xx - 4 - - Payday xx
xx - 4_0 - - Payday xx
xx - 4_1 - - Payday xx
xx - 4_2 - - Payday xx
xx - 6 - - TGIF xx
xx - 7 - - New Activity xx
xx - 9 - - Here is an event xx

The clientID is not being grabbed. I have a feeling that that is the problem. HOW do I grab the ClientID? Can I please just have an answer and not a link to a guru sitting on top of a mountain? I really do not want to fight with this for another four hours.... Yes, I have already viewed all of your examples on using the ToolTipManager. It does not seem complicated at all. However, I am stuck and I just need guidance. Please assist.


0
David
Top achievements
Rank 1
answered on 03 Mar 2009, 01:41 AM
Figured it out due to another thread. This code does the trick. Thanks Simon.

protected

void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)

 

{

 

string clientID = e.Appointment.ClientID;

 

 

RadToolTipManager1.TargetControls.Add(clientID, e.Appointment.ID.ToString(), true);

 

}

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/radscheduler-with-radtooltipmanager-problem.aspx

Tags
ToolTip
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Share this question
or