Firefox未在Gridview模板的编辑模式下显示工具提示

时间:2012-01-06 12:53:28

标签: c# asp.net firefox gridview

因为我正在编辑一条记录,因为它在Internet Explorer中完美运行,我使用编辑模板中的EditText属性设置了用于编辑的工具提示,同样也用于更新文本。现在它正在IE中按预期呈现,但它没有在firefox中显示工具提示, 功能明智,工作正常。

      <asp:CommandField ButtonType="Image" EditText="Click here to edit section" EditImageUrl="../images/edit.gif" HeaderText="Actions"

    UpdateText="click here to update section" UpdateImageUrl="../images/pageok.gif" CancelText="Cancel" 

CancelImageUrl="../images/pagecancel.gif" ShowEditButton="true" 
                                                            ControlStyle-CssClass="LinkNormal" >

3 个答案:

答案 0 :(得分:0)

我不知道为什么它在FireFox中不起作用。在RowDataBound事件期间,您可以尝试以编程方式修改单元格或CommandField控件之一的ToolTip属性:

protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Cells[column_index].ToolTip = "Click here to edit section"; // for cell
        ((ImageButton)e.Row.Cells[column_index].Controls[control_index]).ToolTip = "Click here to edit section"; // for ImageButton
    }
}

示例假设您已转换为ImageButton。

答案 1 :(得分:0)

Stackoverflow reply

您还可以使用项目模板编辑项目模板来实现此目的。这更灵活。

答案 2 :(得分:0)

ToolTip属性呈现为HTML的title属性。检查您的标记并验证该属性是否存在。我试图在我的测试页面上设置工具提示,firefox正确显示它