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

标签 c# asp.net gridview hover tooltip

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

相关文章:

c# - 如何向 inputRadio 添加 on change 事件?

c# - ASP.NET MVC C# : Object reference errors when going to view record details

c# - 从 SHA1 迁移到 SHA2 ASP.net 4.5,C#

asp.net - 无法将AspNetSynchronizationContext传播到TPL任务

asp.net - 如何使用自动生成的列隐藏ASP.NET GridView中的列?

c# - 如果我调用 Thread.Join() 是否需要 volatile?

c# - 打印页面并关闭

c# - 如何在 C# 中找出并防止死锁

c# - GridView 上的复选框在选择后丢失状态

javascript - 如何使用 javascript 以通用方式将 Html.Kendo().Grid 数据导出到 excel?