Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Customize the look of datagrid pagebar

Customize the look of datagrid pagebar

Scheduled Pinned Locked Moved ASP.NET
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    viktor9990
    wrote on last edited by
    #1

    I'm showing data in a datagrid with built in pagination. I want to show on each page 100 records(pagesize = 100) so that the page barwill look like:( [1-100][101-200][201-300][301-400]...), but managed only to do it like([1][2][3]...). Any help is appreciated. Here is my code: public void NewPageIndex(object sender, DataGridPageChangedEventArgs e) { DataGrid_ExtCommMeasPoints.CurrentPageIndex = e.NewPageIndex; BindDataGridInfo(); } public void ItemCreated(Object sender, DataGridItemEventArgs e) { ListItemType lit = e.Item.ItemType; if (lit == ListItemType.Pager) { TableCell pager = (TableCell) e.Item.Controls[0]; for(int i=0; i

    M 1 Reply Last reply
    0
    • V viktor9990

      I'm showing data in a datagrid with built in pagination. I want to show on each page 100 records(pagesize = 100) so that the page barwill look like:( [1-100][101-200][201-300][301-400]...), but managed only to do it like([1][2][3]...). Any help is appreciated. Here is my code: public void NewPageIndex(object sender, DataGridPageChangedEventArgs e) { DataGrid_ExtCommMeasPoints.CurrentPageIndex = e.NewPageIndex; BindDataGridInfo(); } public void ItemCreated(Object sender, DataGridItemEventArgs e) { ListItemType lit = e.Item.ItemType; if (lit == ListItemType.Pager) { TableCell pager = (TableCell) e.Item.Controls[0]; for(int i=0; i

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, IMO, what you might need to do is to provide a snippet of code to populate the start row and end row index values based on the page index. The sample code looks something like:

      ...
      int endRow = myIndex * dataGrid1.PageSize;
      int startRow = endRow - dataGrid1.PageSize + 1;
      lb.Text = "[" + startRow.ToString() + "-" + endRow.ToString() + "]";
      ...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups