JamesJMcDonnell
asked on
Add tooltip capability at table cell level to control for asp.net 2.0 page
Hi Experts,
I need to amend a class module which shows a calendar view of a schedule with ranges of dates held, for booked courses, in database shown in red. The control generates a table cell for each day. I need to show a tooltip whenever the mouse is over any of the cells for a course booking showing the course name and a delegate list. At present there is a course name attribute for the cell. How can I go about this?
I need to amend a class module which shows a calendar view of a schedule with ranges of dates held, for booked courses, in database shown in red. The control generates a table cell for each day. I need to show a tooltip whenever the mouse is over any of the cells for a course booking showing the course name and a delegate list. At present there is a course name attribute for the cell. How can I go about this?
ASKER
ethos,
The table cells are declared as HTMLTableCells and don't have a tool tip property but have innerHTML and innerText properties. Can I use one of these and/or is it better to convert the HTMLCell, HTMLRow and HTMLTable elements to Cell, Row and Table respectively?
James
The table cells are declared as HTMLTableCells and don't have a tool tip property but have innerHTML and innerText properties. Can I use one of these and/or is it better to convert the HTMLCell, HTMLRow and HTMLTable elements to Cell, Row and Table respectively?
James
No, just use the title attribute...
<td title="Help Me">My Content Here </td>
<td title="Help Me">My Content Here </td>
ASKER
The HTMLTableCell itself has no title attribute
Then either code it declarativley or use a custom attribute...
myHTMLTableCell.attributes .add("titl e","Help Me")
myHTMLTableCell.attributes
ASKER
Good, but I want to add specific title content, dynamically, at runtime.
So I've added your code into the following statement:
if (SelectedDates.isSelectedD ate(Caldat e))
{
TblCell.Attributes.Add("ti tle", "help me");
TblCell.BgColor = "RED";
}
in the class module.
In the code behind for a particular page using the control I have:
Private Sub BindScheduleInfo()
Dim ds As DataSet
ds = Commerce.Common.BookingCou rseCollect ion.GetBoo kingSchedu lebyCustom erID(Profi le.custome rID)
Dim row As DataRow
For Each row In ds.Tables(0).Rows
If Not IsDBNull(row("ScheduleDate From")) And Not IsDBNull(row("ScheduleDate To")) Then
CourseSchedule.SelectedDat es.AddRang e(row("Sch eduleDateF rom"), row("ScheduleDateTo"), row("CourseName"))
End If
Next
End Sub
and this makes the cells ,which represent days, red for days that fall in range of course dates.
How can I apply the database values to the cells text attribute values?
So I've added your code into the following statement:
if (SelectedDates.isSelectedD
{
TblCell.Attributes.Add("ti
TblCell.BgColor = "RED";
}
in the class module.
In the code behind for a particular page using the control I have:
Private Sub BindScheduleInfo()
Dim ds As DataSet
ds = Commerce.Common.BookingCou
Dim row As DataRow
For Each row In ds.Tables(0).Rows
If Not IsDBNull(row("ScheduleDate
CourseSchedule.SelectedDat
End If
Next
End Sub
and this makes the cells ,which represent days, red for days that fall in range of course dates.
How can I apply the database values to the cells text attribute values?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In class module have added:
public string ToolTipText
{
get
{
return m_tooltiptext;
}
set
{
m_tooltiptext = value;
}
}
Now I don't know how to call from page logic, if not code behind then do you mean in javascript on html page?
public string ToolTipText
{
get
{
return m_tooltiptext;
}
set
{
m_tooltiptext = value;
}
}
Now I don't know how to call from page logic, if not code behind then do you mean in javascript on html page?
Dim a As New TableCell
a.ToolTip = "Help Me"