ASP.NET datagrid 上一页,下一页,转到第几页怎么做?

ASP.NET datagrid 上一页,下一页,转到第几页怎么做?
2024-11-25 23:54:23
推荐回答(4个)
回答1:

有个是否分页的属性,设置成True

回答2:

用DropDownlist做,启用它的自动回发
protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
{
lbCurrent.Text = (DropDownList1.SelectedIndex + 1).ToString();

pds.CurrentPageIndex = DropDownList1.SelectedIndex;
Binding();
}

回答3:

可以下载个ASpnetpager控件学学怎么用,非常好用,功能完善

回答4:

Protected Sub gvRequests_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvRequests.PageIndexChanging Me.gvRequests.PageIndex = e.NewPageIndex
BindGrid()
End Sub
You need to handle that event and rebind your grid.