datagridview中的分页 [英] pagination in datagridview

查看:76
本文介绍了datagridview中的分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview中有一些数据。我想限制不。行和通过分页的帮助访问其他行。我不想要与数据库建立联系。任何人都可以提供代码..

解决方案

检查一下:

DataGrid-Paging-C-Windows-Forms



A-Simple-way-for-Paging-in-DataGridView-in-WinForm


使用所有数据加载datagridiew。

使用链接butttons,

喜欢: - First Previous Next Last。



每次点击上面的链接按钮,跟踪页面大小并相应地使行可见和不可见。


使用此在GridView中:



 <   asp:GridView     ID   =   GrdV iew_Name    runat   =  server    AllowPaging   =  true    PageSize   =  10    PagerSettings-Mode   = 数字    OnPageIndexChanging   =  GrdView_Name_PageIndexChanging  ...........  





  protected   void  GrdView_Name_PageIndexChanging( object  sender,GridViewPageEventArgs e)
{
GrdView_Name.PageIndex = e.NewPageIndex;
// 再次调用GridView的Bind函数
}


i have some data in gridview. i want to limit the no. of rows and access the other rows by the help of pagination. i donot want nay connection to database. can anybody provide me code..

解决方案

Check this:
DataGrid-Paging-C-Windows-Forms
OR
A-Simple-way-for-Paging-in-DataGridView-in-WinForm


Load your datagridiew with all data.
use link butttons,
like:- First Previous Next Last.

On each click of above link button, keep track of page size & accordingly make rows visible & invisible.


use this in GridView:

<asp:GridView ID="GrdView_Name" runat="server" AllowPaging="true" PageSize="10" PagerSettings-Mode="Numeric" OnPageIndexChanging="GrdView_Name_PageIndexChanging"...........



protected void GrdView_Name_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GrdView_Name.PageIndex = e.NewPageIndex;
    // Again call Bind function of GridView
}


这篇关于datagridview中的分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆