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. Grid View

Grid View

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

    I have a gridview on a webform. The table with the data I want it to display has a column with contents like: "Item1 Item2 Item3". What I want to do is make each one of these items appear on a new line in the cell that they are in. How would I do this? I tried using "\r\n" and "< br >" between the items, but no luck :( eg.

    Some Column           
    

    | Item1 |
    | Item2 |
    | Item3 |
    | ... |
    |___________________|___________
    | |
    | |
    | |
    | |

    If this will be too much trouble does anyone know a similar control that I can get the same effect with? Thanks for any help ;)


    M 1 Reply Last reply
    0
    • S Sean89

      I have a gridview on a webform. The table with the data I want it to display has a column with contents like: "Item1 Item2 Item3". What I want to do is make each one of these items appear on a new line in the cell that they are in. How would I do this? I tried using "\r\n" and "< br >" between the items, but no luck :( eg.

      Some Column           
      

      | Item1 |
      | Item2 |
      | Item3 |
      | ... |
      |___________________|___________
      | |
      | |
      | |
      | |

      If this will be too much trouble does anyone know a similar control that I can get the same effect with? Thanks for any help ;)


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

      Sean89 wrote:

      The table with the data I want it to display has a column with contents like: "Item1 Item2 Item3".

      So assuming you probably know how to slit the items.

      Sean89 wrote:

      How would I do this? I tried using "\r\n" and "< br >" between the items,

      You can use the TemplateField here. Before you send the output to the page in this TemplateField, you can process data a bit by splitting the items and seperate by the <br/>, then output to the page. Can I see your sample code to know why it does not work with you?

      S 1 Reply Last reply
      0
      • M minhpc_bk

        Sean89 wrote:

        The table with the data I want it to display has a column with contents like: "Item1 Item2 Item3".

        So assuming you probably know how to slit the items.

        Sean89 wrote:

        How would I do this? I tried using "\r\n" and "< br >" between the items,

        You can use the TemplateField here. Before you send the output to the page in this TemplateField, you can process data a bit by splitting the items and seperate by the <br/>, then output to the page. Can I see your sample code to know why it does not work with you?

        S Offline
        S Offline
        Sean89
        wrote on last edited by
        #3

        Basically I have two related tables in a database. I put both of them into a dataset and construct one table based in there relation, and bind it to the control. However, I wasnt using the template field. How do I use it once I have added one to the grid? Thanks for the reply


        M 1 Reply Last reply
        0
        • S Sean89

          Basically I have two related tables in a database. I put both of them into a dataset and construct one table based in there relation, and bind it to the control. However, I wasnt using the template field. How do I use it once I have added one to the grid? Thanks for the reply


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

          Looks like you might want to build the Master/Details data with the GridView control. You can see a series of the GridView examples from here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx.asp[^]

          S 1 Reply Last reply
          0
          • M minhpc_bk

            Looks like you might want to build the Master/Details data with the GridView control. You can see a series of the GridView examples from here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx.asp[^]

            S Offline
            S Offline
            Sean89
            wrote on last edited by
            #5

            Thanks for the reply. I did some reading last night from what you gave me and some articles I found via google. It's all working now. Thanks again!


            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