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. Goodlooking Scrollable DataGrid

Goodlooking Scrollable DataGrid

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
5 Posts 3 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
    RickardB
    wrote on last edited by
    #1

    I am using a DataGrid WebServer Control to historical data to the user. Since their amount of data that the user potentially wants to look at is fairly large I need to use some kind of scrolling technique. Paging simply doesn’t look good enough. I am currently solving this problem by putting a DIV element on the outside of the DataGrid. It works, but it doesn’t look good enough. Anyone who has a better idea about how to solve this problem? Rickard

    A 1 Reply Last reply
    0
    • R RickardB

      I am using a DataGrid WebServer Control to historical data to the user. Since their amount of data that the user potentially wants to look at is fairly large I need to use some kind of scrolling technique. Paging simply doesn’t look good enough. I am currently solving this problem by putting a DIV element on the outside of the DataGrid. It works, but it doesn’t look good enough. Anyone who has a better idea about how to solve this problem? Rickard

      A Offline
      A Offline
      avnrao
      wrote on last edited by
      #2

      You are correct. Using DIV, when you scroll down, the column names also scroll. the other way is to have column header outer to the Grid..and have constant width to each of the column. Here you need to set AutoGenerate columns to false and include all columns and respective widths in the data grid. you can refer to this article : http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=564

      R 1 Reply Last reply
      0
      • A avnrao

        You are correct. Using DIV, when you scroll down, the column names also scroll. the other way is to have column header outer to the Grid..and have constant width to each of the column. Here you need to set AutoGenerate columns to false and include all columns and respective widths in the data grid. you can refer to this article : http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=564

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

        Thanks. I can't do this however since the the number of columns and the column headers are unknown at design time. They are generated in run-time based on user interaction. Or is there a way to add columns to the datagrid programmatically in run time? Have to look into this... Rickard

        D 1 Reply Last reply
        0
        • R RickardB

          Thanks. I can't do this however since the the number of columns and the column headers are unknown at design time. They are generated in run-time based on user interaction. Or is there a way to add columns to the datagrid programmatically in run time? Have to look into this... Rickard

          D Offline
          D Offline
          dbetting
          wrote on last edited by
          #4

          Depending on how dynamic your SQL is, one of the things you can consider is to create the crid with the maximum columns. Then at run time you dynamically make the appropriate columns visible. If your SQL is really dynamic, it just makes it a little more work set up the SQL to bring back a column like ["" as ColumnName] as a place holder for some of the invisible columns. It isn't something that should be really difficult to do, it will just be a bit tedious.

          R 1 Reply Last reply
          0
          • D dbetting

            Depending on how dynamic your SQL is, one of the things you can consider is to create the crid with the maximum columns. Then at run time you dynamically make the appropriate columns visible. If your SQL is really dynamic, it just makes it a little more work set up the SQL to bring back a column like ["" as ColumnName] as a place holder for some of the invisible columns. It isn't something that should be really difficult to do, it will just be a bit tedious.

            R Offline
            R Offline
            RickardB
            wrote on last edited by
            #5

            Thanks, could be an idea. Will consider it. My data source if however not an SQL source, its an OPC History source. But it doesn't really matter since I am writing data read/write functions from/to OPC myself. Rickard

            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