绑定数据时Gridview分页中的错误 无法将类型为“ System.EventArgs”的对象转换为类型为“ System.Web.UI.WebControls.GridViewPageEventArgs”
我有一个数据绑定事件来动态添加标头。当页面首次加载时,它加载正常。但是当我尝试单击下一页时,它在数据绑定事件中出错
Protected Sub OnDataBoundlvs(sender As Object, e As EventArgs)
Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
Dim cell As New TableHeaderCell()
cell.Text = "Network"
cell.ColumnSpan = 1
cell.CssClass = "FrozenHeader"
row.Controls.Add(cell)
End Sub
Protected Sub OnPaging3(sender As Object, e As GridViewPageEventArgs) Handles LVSGrid.PageIndexChanging
LVSGrid.PageIndex = e.NewPageIndex
LVSGrid.DataBind()
End Sub