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

RadCalendar with RadToolTip

1 Answer 78 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 22 Sep 2008, 02:52 PM
Anyone know ho to integrate tooltip in the calendar? I want a RadToolTip pop up on mouse over on a day with an event.

I have the calenday being filled with events from my database and would like a quick preview of the event in the form of a RadTooltip.

I tried the following and it does not work.

Dim monthView As Telerik.Web.UI.Calendar.View.MonthView = DirectCast(RadCalendar1.CalendarView, Telerik.Web.UI.Calendar.View.MonthView)

If e.Day.[Date] >= monthView.MonthStartDate AndAlso e.Day.[Date] <= monthView.MonthEndDate Then

For i As Integer = 0 To table.Rows.Count - 1

Try

Dim eventDate As DateTime = table.Rows(i)("EventDate").ToString()

If e.Day.[Date] = eventDate.Date Then

e.Cell.Text += table.Rows(i)(

"EventName").ToString()

RadToolTipManager1.TargetControls.Add(Button1.ClientID, table.Rows(i)(

"EventName").ToString(), True)

RadToolTipManager1.TargetControls.Add(e.Cell.ClientID, table.Rows(i)(

"EventName").ToString(), True)

End If

Catch ex As Exception

End Try

Next

End If



On mouse over all I get is the date popup and the tooltipmanager never fires off OnAjaxUpdate.

<

telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Position="BottomRight"Animation="Fade" OnAjaxUpdate="OnAjaxUpdate" Skin="Default" Width="180px" Height="150px"Style="font-size: 18px; text-align: center; font-family: Arial;"></telerik:RadToolTipManager>

1 Answer, 1 is accepted

Sort by
0
Michele
Top achievements
Rank 2
answered on 25 Sep 2008, 02:16 PM
solved 

protected

void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)

{

Label lbl =

new Label();

lbl.Text =

"The OnAjaxUpdate event was fired!";

e.UpdatePanel.ContentTemplateContainer.Controls.Add(lbl);

}

protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)

{

e.Cell.Attributes.Add(

"ID", e.Day.Date.ToString());

RadToolTipManager1.TargetControls.Add(e.Cell.Attributes[

"ID"], true);

}

Tags
Calendar
Asked by
Michele
Top achievements
Rank 2
Answers by
Michele
Top achievements
Rank 2
Share this question
or