GridView高级应用问题,请教!!

 Public PageNo As New DropDownList
    Protected Sub gviewemployees_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim bottonPagerRow As GridViewRow = gviewemployees.BottomPagerRow
        Dim bottonPagerNo As New Label()
        bottonPagerNo.Text = "目前所在分页码(" & (gviewemployees.PageIndex + 1) & "/" & gviewemployees.PageCount.ToString() & ")"
        bottonPagerRow.Cells(0).Controls.Add(bottonPagerNo)

        Dim myLiteral As New Literal()
        myLiteral.Text = "<BR/>"
        bottonPagerRow.Cells(0).Controls.Add(myLiteral)

        '动态下拉框分页
        Dim I As Integer
        Dim PageNo As New DropDownList
        PageNo.ID = "pageno"
        PageNo.AutoPostBack = True

        PageNo.Items.Clear()
        For I = 0 To gviewemployees.PageCount - 1
            PageNo.Items.Add(I + 1)
        Next
        PageNo.SelectedItem.Text = Me.gviewemployees.PageIndex + 1
        AddHandler PageNo.TextChanged, AddressOf PageNo_TextChanged
        bottonPagerRow.Cells(0).Controls.Add(PageNo)
    End Sub
    Protected Sub PageNo_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Me.gviewemployees.PageIndex = Val(PageNo.SelectedItem.Text) - 1
        gviewemployees_DataBound(sender, e)
    End Sub 

为什么在改变下拉框的内容时, gridview控件的BottomPagerRow中的下拉框不见了??

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值