C# 增加gridview标题工具提示显示时间

C# 增加gridview标题工具提示显示时间,c#,asp.net,gridview,header,tooltip,C#,Asp.net,Gridview,Header,Tooltip,早上好 我有一个gridview,它使用一个字典来显示针对所述gridview中标题的工具提示 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { Dictionary<String, String> headerTooltips = new Dictionary<String, String>();

早上好

我有一个gridview,它使用一个字典来显示针对所述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]);

                                            } 

                                    } 
                            } 
                    } 
            }

        }
那很好,工作得很漂亮…太好了

但是,有些工具提示比默认的5000ms长,有人知道我如何用当前使用的代码以编程方式延长显示时间吗


感谢您的帮助。

这是浏览器设置,您无法更改。 工具提示在浏览器上作为元素标记的标题参数呈现,此时无法控制浏览器。
您可以使用MoseOver和MouseOut事件调用一个自制的javascript函数,该函数显示元素附近的浮动俯冲,将元素引用传递给js函数。

您是否使用秒表进行时间测试?也许GetType的速度变慢了你的代码和字典中有多少元素?否则我想你什么也做不了。我不确定工具提示是否是浏览器设置。谢谢你澄清。正如您所说,我将使用javascript和mouseover方法。谢谢你的意见。