【问题标题】:Firefox is not displaying tooltip in Edit mode of Gridview templateFirefox 在 Gridview 模板的编辑模式下不显示工具提示
【发布时间】:2012-01-06 12:53:28
【问题描述】:

当我正在编辑一条记录时,它在 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" >

【问题讨论】:

    标签: c# asp.net firefox gridview


    【解决方案1】:

    Stackoverflow reply

    您也可以为此使用项目模板编辑项目模板。这样更灵活。

    【讨论】:

      【解决方案2】:

      我不知道为什么它在 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。

      【讨论】:

      • 很烦,因为我只有一个单元格,处于编辑模式,里面有多个按钮,我们如何访问单元格.. 到目前为止,三个按钮在一个单元格中。
      • 您可以使用上述方法并使用 control_index 索引三个按钮之一,可能索引 0、1 或 2。
      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-03
        • 2021-02-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多