Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
Dim RecoderCount As Integer = Me.GridView1.Rows.Count
If e.Row.RowType = DataControlRowType.Pager Then
e.Row.Controls.Clear()
Dim tc As New TableCell()
Dim txtNewPageIndex As New System.Web.UI.WebControls.TextBox()
txtNewPageIndex.Width = 20
tc.Controls.Add(txtNewPageIndex)
e.Row.Controls.Add(tc)
End If
End Sub
请问,我怎么获得这个txtNewPageIndex控件? CType(GridView1.BottomPagerRow.FindControl("txtNewPageIndex"), System.Web.UI.WebControls.TextBox)
这样写不对,找不到这个控件。
Dim RecoderCount As Integer = Me.GridView1.Rows.Count
If e.Row.RowType = DataControlRowType.Pager Then
e.Row.Controls.Clear()
Dim tc As New TableCell()
Dim txtNewPageIndex As New System.Web.UI.WebControls.TextBox()
txtNewPageIndex.Width = 20
tc.Controls.Add(txtNewPageIndex)
e.Row.Controls.Add(tc)
End If
End Sub
请问,我怎么获得这个txtNewPageIndex控件? CType(GridView1.BottomPagerRow.FindControl("txtNewPageIndex"), System.Web.UI.WebControls.TextBox)
这样写不对,找不到这个控件。
解决方案 »
- 截取中文、英文和图片长度问题
- 404问题 求解 急!!!!
- 一个关于引用为空的问题
- 如何控制DropDownList中的ListItem的显示?
- 我想把CS中的变量加入到HyperLink 属性NavigaetUrl中不知怎么写???
- 在线等,<globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312" />的问题
- 数据库索引问题,我的表是一直更新的表,我怎么才能查到数据(调度?)
- crystal Report 导出Excel 时报 Database logon failed.
- 很酷的难题,喜欢挑战的请进来……
- 如何捕捉到在DATAGRID中单击行中任意位置的ID?
- 急求!!!请问何如使用BBS模块?
- ActiveX如何获取返回值!在线等!
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
Dim RecoderCount As Integer = Me.GridView1.Rows.Count
If e.Row.RowType = DataControlRowType.Pager Then
e.Row.Controls.Clear()
Dim tc As New TableCell()
Dim txtNewPageIndex As New System.Web.UI.WebControls.TextBox()
txtNewPageIndex.Width = 20
txtNewPageIndex.id="txtNewPageIndex1" 加了句这个,
tc.Controls.Add(txtNewPageIndex)
e.Row.Controls.Add(tc)
End If
End Sub 原来我老把变量名txtNewPageIndex认为就是那控件的id
CType(GridView1.BottomPagerRow.FindControl("txtNewPageIndex1"), System.Web.UI.WebControls.TextBox)