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. General Programming
  3. C#
  4. Newline in DataGrid

Newline in DataGrid

Scheduled Pinned Locked Moved C#
helpquestion
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
    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? eg.

    Some Column           
    

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

    Thanks for any help ;)


    N 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? eg.

      Some Column           
      

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

      Thanks for any help ;)


      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Well, have you tried to format the text of the cell as : "Item1\r\nItem2\r\nItem3\r\n"?

      S 1 Reply Last reply
      0
      • N Nader Elshehabi

        Well, have you tried to format the text of the cell as : "Item1\r\nItem2\r\nItem3\r\n"?

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

        Ohh yes sorry I forgot to mention I used \r\n and Environment.NewLine (which is pretty much the same thing) with no luck.


        J 1 Reply Last reply
        0
        • S Sean89

          Ohh yes sorry I forgot to mention I used \r\n and Environment.NewLine (which is pretty much the same thing) with no luck.


          J Offline
          J Offline
          Josh Smith
          wrote on last edited by
          #4

          Try inserting
          tags instead of newlines. That might do the trick. Josh

          L 1 Reply Last reply
          0
          • J Josh Smith

            Try inserting
            tags instead of newlines. That might do the trick. Josh

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            Good spot :) (especially since its in the wrong forum)**

            xacc.ide-0.1.3.14 - Now with syntax support for PowerShell
            xacc.ide-0.1.3.13 source code

            **

            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