gridview增加計算列(ASP.NET)
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)e.Row.Cells(2).Text = (Convert.ToInt32(e.Row.Cells(0).Text) * Convert.ToDouble(e.Row.Cells(1).Text)).ToString()
End Sub
因為會從標題列開始計算會造成異常,請教如何從標題列下面開始計算,很謝謝大家的幫忙^^ 處理前先判斷是不是資料列
If e.Row.RowType = DataControlRowType.DataRow Then
... '略
End If [quote]處理前先判斷是不是資料列
If e.Row.RowType = DataControlRowType.DataRow Then
... '略
End If
[size=2][color=#999999]Luc 發表於 2010-8-15 00:24[/color] [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=5161&ptid=1043][img]http://forum.twbts.com/images/common/back.gif[/img][/url][/size][/quote]
謝謝Luc 的幫忙^^
頁:
[1]