早上全部。增加gridview标题工具提示显示时间
我有一个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,有谁知道我可以用我目前使用的代码以编程方式延长显示时间吗?
感激地收到任何帮助。
你是否使用秒表进行时间测试?也许GetType越来越慢你的代码和字典中有多少元素?否则我认为你什么都做不了。 – cem