Link to home
Start Free TrialLog in
Avatar of sbornstein2
sbornstein2

asked on

ASP.Net + Extending ToolTip display time?

I have a OnRowDataBound that I set the row.tooltip to a value.  I need to increase the display time.  I do not see any options for this when doing a tooltip.

Anyway I can do this?

Code below.

protected void EDIJobData_OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string listaccts = DataBinder.Eval(e.Row.DataItem, "listaccts").ToString();
 
                string[] stringColl = listaccts.Split(new char[] { ',' });
 
                int count = 0;
 
                listaccts = string.Empty;
 
                foreach (string aString in stringColl)
                {
                  if (count == 4){
                      listaccts += "\r\n";
                       count = 0;
                }
                listaccts += " " + aString;
                count++;
                }
 
                e.Row.ToolTip = listaccts;
            }
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of abel
abel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cauos
cauos

Avatar of sbornstein2

ASKER

i need to assing the tooltip through my code though and on the onrowdatabound nothing in the ASPX page itself?
it is in a gridview so it has to be dynamic to the row.
The links above are either for winforms applications (cauos solution) or for asp.net web applications (my solution). You can use either of the solutions dynamically. The first link I mentioned above has a demo page: http://www.dhtmlgoodies.com/scripts/tooltip_shadow/tooltip_shadow.html, if that works a bit the way you want it (you can set the tooltip close function upon a timer, if you want, or just keep it the way it is) I, or some other expert can help you with implementing that in your solution.
this should work and call in the rowdatabound.  Thanks
here is the issue though.  You see the line break I do after every 4 accounts, this gets messed up and unterminated string constant on the line break as I see in the source code the spacing throws it off.  I have to do this though to make sure the width of the tooltip stays a certain width otherwise it goes way off the page.
(from grading comment): "this should work and call in the rowdatabound.  Thanks"
(from last comment): "I have to do this though to make sure the width of the tooltip stays a certain width otherwise it goes way off the page."

not sure if you mean with this that you have found a way, or that you are still struggling with it. The tooltips can be given a certain width or height through CSS, depending on which tooltip solution you went for in the end.
hey it is okay, I am now also using a double click alert event on the row which works fine if they want to keep it up.  Thanks
nice! glad it works :)