Solved

Add tooltip capability at table cell level to control for asp.net 2.0 page

Posted on 2006-11-24
8
2,967 Views
Last Modified: 2008-01-09
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?
0
Comment
Question by:JamesJMcDonnell
  • 4
  • 4
8 Comments
 
LVL 11

Expert Comment

by:ethoths
Comment Utility
There is a tool tip property on the table cell. Can you not simply set the value on this?

        Dim a As New TableCell
        a.ToolTip = "Help Me"
0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
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
0
 
LVL 11

Expert Comment

by:ethoths
Comment Utility
No, just use the title attribute...

<td title="Help Me">My Content Here </td>
0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
The HTMLTableCell itself has no title attribute
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 11

Expert Comment

by:ethoths
Comment Utility
Then either code it declarativley or use a custom attribute...

myHTMLTableCell.attributes.add("title","Help Me")
0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
Good, but I want to add specific title content, dynamically, at runtime.
So I've added your code into the following statement:

if (SelectedDates.isSelectedDate(Caldate))
                {
                    TblCell.Attributes.Add("title", "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.BookingCourseCollection.GetBookingSchedulebyCustomerID(Profile.customerID)
        Dim row As DataRow
        For Each row In ds.Tables(0).Rows
            If Not IsDBNull(row("ScheduleDateFrom")) And Not IsDBNull(row("ScheduleDateTo")) Then
                CourseSchedule.SelectedDates.AddRange(row("ScheduleDateFrom"), 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?
0
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
Comment Utility
Add a property to the class module to accept the phrase you want to display. Call this from your page logice to set it's value to the phrase you want to display. Then in the code behind, rather than usnig "help me" just use the property that was previously set.

0
 

Author Comment

by:JamesJMcDonnell
Comment Utility
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?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now