如何在gridview中获取动态添加文本框的值。得到一个错误,引用对象的值为nothing

时间:2015-05-19 07:07:25

标签: asp.net vb.net

我添加了Textbox 受保护的子gvReconciliation_RowDataBound(发件人为对象,e为GridViewRowEventArgs)处理gvReconciliation.RowDataBound

    If e.Row.RowType = DataControlRowType.DataRow Then

        Dim txtRemarks As New TextBox()
        txtRemarks.ID = "txtRemarks"
        txtRemarks.Text = TryCast(e.Row.DataItem, DataRowView).Row("Remarks").ToString()
        e.Row.Cells(10).Controls.Add(txtRemarks)


    End If

End Sub

0 个答案:

没有答案