C Sharp .Net Datagridview分页
问题描述:
我想为C#.net的datagridview控件中的第一个,下一个,上一个,最后一个按钮编写用于分页的单个通用函数.任何人都可以帮助我.please
I want to write a single common function for paging with first,next,previous,last buttons in datagridview control in C#.net.Any one can help me .please
答
您本可以尝试使用Google:它很快就找到了我. 在VirtualMode中使用DataGridView对数据进行分页 [
You could have tried Google: it found me this very quickly. Paging Data with DataGridView in VirtualMode[^]
public partial class Sample : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
PagingTableAdapter pAdapter = new PagingTableAdapter();
DataGridView1.DataSource = pAdapter.FetchRecords(10,5);
DataGridView1.DataBind();
}
}
签出:
DataGrid分页-C#Windows窗体 [
check this out:
DataGrid Paging - C# Windows Forms[^]
hope it helps :)