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. Display multiple columns in Gridview from One Column of SQL table

Display multiple columns in Gridview from One Column of SQL table

Scheduled Pinned Locked Moved ASP.NET
database
5 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.
  • S Offline
    S Offline
    sundaramoorthy b
    wrote on last edited by
    #1

    I have one column(like 1 to 100 values)in table. 1 2 3 4 5 . . ... Now I need to Display multiple columns in Gridview like 1 6 ... 2 7 3 8 4 9 5 10

    R R A 3 Replies Last reply
    0
    • S sundaramoorthy b

      I have one column(like 1 to 100 values)in table. 1 2 3 4 5 . . ... Now I need to Display multiple columns in Gridview like 1 6 ... 2 7 3 8 4 9 5 10

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      Where will your data come from? How will you match it to the first column? You could populate the stored procedure according to your needs with a column containing the appropriate data from within the database (where data should be handled) and then bind that to the grid.

      "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

      1 Reply Last reply
      0
      • S sundaramoorthy b

        I have one column(like 1 to 100 values)in table. 1 2 3 4 5 . . ... Now I need to Display multiple columns in Gridview like 1 6 ... 2 7 3 8 4 9 5 10

        R Offline
        R Offline
        Rahul Rajat Singh
        wrote on last edited by
        #3

        It would be better to use datalist to do that. DataList is actually made to handle such scenarios. Set the datalist Datasource to the datatable containing this data. Set the repeatdirection=vertical. repeatlayout=table and repeatcolumns=2. Thats it you have what you want.

        Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.

        A 1 Reply Last reply
        0
        • R Rahul Rajat Singh

          It would be better to use datalist to do that. DataList is actually made to handle such scenarios. Set the datalist Datasource to the datatable containing this data. Set the repeatdirection=vertical. repeatlayout=table and repeatcolumns=2. Thats it you have what you want.

          Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.

          A Offline
          A Offline
          AshishChaudha
          wrote on last edited by
          #4

          Better option is to use of Datalist..Datalist fullfills your requirement without any efforts.

          1 Reply Last reply
          0
          • S sundaramoorthy b

            I have one column(like 1 to 100 values)in table. 1 2 3 4 5 . . ... Now I need to Display multiple columns in Gridview like 1 6 ... 2 7 3 8 4 9 5 10

            A Offline
            A Offline
            AshishChaudha
            wrote on last edited by
            #5

            Better option is to use of Datalist..Datalist fullfills your requirement without any efforts.

            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