views:

306

answers:

1

Morning all.

I have a gridview that uses a dictionary to show tooltips against the header within said gridview.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            Dictionary<String, String> headerTooltips = new Dictionary<String, String>();


            headerTooltips["Product ID"] = "product identification code";
            headerTooltips["Product Description"] = "description of the product";

        { 
                if (e.Row.RowType == DataControlRowType.Header) 
                    { 
                        foreach (TableCell cell in e.Row.Cells) 
                            { 
                                foreach (System.Web.UI.Control ctl in cell.Controls) 
                                    { 
                                        if (ctl.GetType().ToString().Contains("DataControlLinkButton")) 
                                            {
                                                string headerText = ((LinkButton)ctl).Text;
                                                cell.Attributes.Add("title", headerTooltips[headerText]);

                                            } 

                                    } 
                            } 
                    } 
            }

        }

That's fine and working beautifully...super.

However, some of the tooltips take longer than the default 5000ms, does anyone know how I can programmatically extended this display time with the code I am currently using?

Any help gratefully received.

A: 

It's a browser setting, you can't change it. The tooltip gets rendered on the browser as the title parameter of the element tag, and you can't control the browser at that point. You could use MoseOver and MouseOut events to call a self-made javascript function showing a floating dive near your element, passing the element reference to the js function.

Orestes C.A.
I wasn't sure whether the tooltip was a browser setting or not..thanks for clearing that up.As you say, I'll use javascript and the mouseover method. Thanks for the input.
Ricardo Deano