c# - Display different number of records at each page in gridview -
this code displays 10 records par page in gridview
for (int = 0; < ds.tables[0].rows.count; i++) { count += 1; } cnt = ds.tables[0].rows.count; pageddatasource pagedata = new pageddatasource(); pagedata.datasource = ds.tables[0].defaultview; pagedata.allowpaging = true; if (pgnum < 1) { pagedata.pagesize = 10; } else { pagedata.pagesize = 10; } pagedata.currentpageindex = pgnum; int vcnt = cnt / pagedata.pagesize; if (pgnum < 1) { panel1.visible = true; lnkprevious.visible = false; } else if (pgnum > 0) { panel1.visible = false; lnkprevious.visible = true; } if (pgnum == vcnt) { lnknext.visible = false; } else if (pgnum < vcnt) { lnknext.visible = true; } repeatvalues.datasource = pagedata; repeatvalues.databind();
i want display 10 records in first page , 20 records second page. appreciated.
check link:
http://www.dotnetcurry.com/showarticle.aspx?id=244
hope gives idea indexing functionalty.
Comments
Post a Comment