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. how to add scrollbars to asp.net datagrid

how to add scrollbars to asp.net datagrid

Scheduled Pinned Locked Moved ASP.NET
csharpcssasp-netalgorithms
6 Posts 4 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.
  • R Offline
    R Offline
    RanaDear
    wrote on last edited by
    #1

    how i can add scrollbars to datagrid so that sorting for the grid via headers is allowed ,header should be fixed and vertical scroll bar should start from first record. I read few articles pertaining to addition of scrollbars to aso.net datgrid,but they dont satisfy desired conditions. remember header should be fixed,sorting should be allowed via headers. plz give me the code vb.net if u can? Warm regards Rana

    D H 2 Replies Last reply
    0
    • R RanaDear

      how i can add scrollbars to datagrid so that sorting for the grid via headers is allowed ,header should be fixed and vertical scroll bar should start from first record. I read few articles pertaining to addition of scrollbars to aso.net datgrid,but they dont satisfy desired conditions. remember header should be fixed,sorting should be allowed via headers. plz give me the code vb.net if u can? Warm regards Rana

      D Offline
      D Offline
      devvvy
      wrote on last edited by
      #2

      Scroll bars? Why not just do paging? Norman Fung

      R 1 Reply Last reply
      0
      • D devvvy

        Scroll bars? Why not just do paging? Norman Fung

        R Offline
        R Offline
        RanaDear
        wrote on last edited by
        #3

        i am using paging also but i got a textbox at the top of the grid so that user can view as many records as he can .To achieve this i direly require scrollbars.Header should be static and sorting must be enabled how to do this? Warm regards Rana

        H 1 Reply Last reply
        0
        • R RanaDear

          i am using paging also but i got a textbox at the top of the grid so that user can view as many records as he can .To achieve this i direly require scrollbars.Header should be static and sorting must be enabled how to do this? Warm regards Rana

          H Offline
          H Offline
          Hercules01
          wrote on last edited by
          #4

          i have the same problem but i need the scrollbar Horizintally!

          H 1 Reply Last reply
          0
          • R RanaDear

            how i can add scrollbars to datagrid so that sorting for the grid via headers is allowed ,header should be fixed and vertical scroll bar should start from first record. I read few articles pertaining to addition of scrollbars to aso.net datgrid,but they dont satisfy desired conditions. remember header should be fixed,sorting should be allowed via headers. plz give me the code vb.net if u can? Warm regards Rana

            H Offline
            H Offline
            Harmonium
            wrote on last edited by
            #5

            My solution to adding a scrollbar to a DataGrid along with keeping a header with sort ability positioned at the top at all times is as follows: From HTML view I added a DIV for the Header tables and one for the DataGrid so the columns line up properly. I also included some CSS classes that I used in the tables to set the layour for the cells. From the Code Behind file you will need to set a datasource to the grid and control any sorting . Sorting can be controlled from the tablecells in the header table by putting linkbuttons in the place of the table cell labels. You can then call a sort routine with the column name to be sorted to get the sort result you want. I wish I could have made this a quicker response, but the process to get this done is a little cumbersome. Not impossible or difficult, just a bit messy. Hope this helps....

            1 Reply Last reply
            0
            • H Hercules01

              i have the same problem but i need the scrollbar Horizintally!

              H Offline
              H Offline
              Harmonium
              wrote on last edited by
              #6

              Adding the DIV as mentioned in my last response to this post should also handle the horizontal scroll.

              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