2012-01-06 58 views
0

的編輯模式下顯示工具提示,因爲我編輯的記錄,作爲其在Internet Explorer中完美的工作,我通過使用編輯模板的EditText屬性,同樣也爲更新文本設置編輯工具提示。現在它在IE中像預期的那樣渲染,但它並沒有在Firefox中顯示工具提示,它的功能明智,它的工作正常。Firefox是不是在GridView的模板

 <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" > 

回答

0

我不知道爲什麼它在FireFox中不起作用。你可以嘗試在編程RowDataBound事件期間修改無論是細胞或CommandField中的控件之一的工具提示屬性:

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。

+0

brissles因爲我只有一個細胞,whcih在編輯模式下,裏面坐了multpile按鈕,我們如何可以訪問細胞..截至目前三個按鈕在一個單元格中。 – 2012-01-06 13:05:05

+0

您可以使用上述方法並使用control_index索引三個按鈕之一,可能是索引0,1或2。 – Brissles 2012-01-06 13:11:47

0

ToolTip屬性呈現爲HTML的title屬性。檢查您的標記並驗證該房產是否存在。我試着設置提示我的測試頁和Firefox正確地顯示它