gpt4 book ai didi

c# - 如何在 GridView 行悬停上显示工具提示

转载 作者:太空狗 更新时间:2023-10-29 20:00:01 24 4
gpt4 key购买 nike

我需要在鼠标放在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com