2013-11-23 19 views
0

我知道這已經回答了好幾次。但是當我檢查了我的許多代碼之後,它無法工作,我不得不尋求幫助。asp.gridview整行選擇不工作

我的aspx代碼:

<asp:GridView CssClass="filled" ID="gvuMsgBox" runat="server" AllowPaging="True" 
     AutoGenerateColumns="False" DataKeyNames="msgID" GridLines="Both" 
     PagerStyle-CssClass="pgr" PagerSettings-PageButtonCount="10"> 

我rowDataBoundEvent事件:

Protected Sub gvuMsgBox_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvuMsgBox.RowDataBound 
    If e.Row.RowType = DataControlRowType.DataRow Then 
     e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';this.style.textDecoration='underline';") 
     e.Row.Attributes.Add("onmouseout", "this.style.textDecoration='none';") 
     e.Row.Attributes.Add("onclick", "javascript:alert('" & FormatURL(CInt(CType(e.Row.Cells(0).FindControl("litId"), Literal).Text)) + "');") 
    End If 
End Sub 

FYI我用zurb基礎JavaScript和CSS代碼響應東西。 同時追蹤屬性收集,一切正常。 二手螢火蟲,無法找到的這些屬性的東西任何痕跡的瀏覽器!?! 並沒有影響我的GridView。沒有行高亮顯示了,沒有報警:(

任何想法,爲什麼這不工作

回答

0

所有我放棄後,搬到了其他緊迫的工作現在我。有一些時間來處理這個問題,發現問題根源。因此,它可以幫助別人。 我工作的程序,有一些cssproviders,我錯過了。 的cssproviders阻止我的應用代碼,所以工作時我改變了cssproviders的我需要他們的方式,現在一切正常。

運氣

0

這爲我工作:

Protected Sub gvuMsgBox_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles gvuMsgBox.RowDataBound 
     If (e.Row.RowType = DataControlRowType.DataRow) Then 
      e.Row.Attributes.Add("style", "cursor:pointer;") 
      e.Row.Attributes.Add("onmouseover", "this.style.textDecoration='underline';") 
      e.Row.Attributes.Add("onmouseout", "this.style.textDecoration='none';") 
      e.Row.Attributes.Add("onclick", "javascript:alert('" & FormatURL(CInt(CType(e.Row.Cells(0).FindControl("litId"), Literal).Text)) + "');") 
     End If 
End Sub 
+0

對不起,不能正常工作。像之前的代碼運行良好,屬性集合充滿了我們想要的東西。但沒有效果。 – vahid

+0

[這裏](https://drive.google.com/file/d/0B6i8p65gmkp0T083d2VmaFVlV00/edit?usp=sharing)的鏈接,我的測試項目。它在FF,Chrome,IE和Opera中工作正常。 – afzalulh

+0

謝謝你,我知道你的代碼正在工作,我的工作也在正常的項目中。我在我的問題(基礎)中提到了一堆css/js的響應式主題。我不知道有關混合物我無法通過螢火蟲在呈現的HTML中看到我的動態樣式。我需要一個解決方案來跟蹤他們不發現它尚未 – vahid