我需要在鼠标放在 GridView 行上时显示工具提示 (onmouseover)
我需要在 GridView_RowData
我该怎么做?
我可以在 e.Row.Attributes.Add(...
中执行此操作吗??
最佳答案
像这样尝试...
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//use this way
e.Row.ToolTip = "My FooBar tooltip";
//or use this way
e.Row.Attributes.Add("title", "My FooBar tooltip");
}
}
这将显示整行的工具提示。如果您需要在特定控件上显示,则找到该控件并将 Tooltip
属性设置为您自己的标题...
关于c# - 如何在 GridView 行悬停上显示工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13154280/