0

实际上我的问题是我想在gridview的页脚行中插入新行,同时单击gridview之外的按钮,我无法在gridview的页脚行中获取文本框的值

我的编码是

将 footerRow 调暗为 GridViewRow = grvTBD_LoanProducts.FooterRow
Dim sStateCode As String = TryCast(footerRow.FindControl("txtStateCode"), TextBox).Text
Dim sEntryTypeID As String = TryCast(footerRow.FindControl("txtEntryTypeID"),TextBox).Text

上面的编码不起作用帮助我修复它提前谢谢

4

1 回答 1

0

试试这段代码,它可能会起作用:

Protected Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs)
    Dim txtName As TextBox = TryCast(GridView1.FooterRow.FindControl("txtStateCode"), TextBox)
    Dim aa As String = txtName.Text
End Sub
于 2013-10-24T09:33:07.177 回答