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. DataGridView WordWrap

DataGridView WordWrap

Scheduled Pinned Locked Moved C#
tutorial
2 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.
  • K Offline
    K Offline
    kalyanPaladugu
    wrote on last edited by
    #1

    Iam developing a windows application. I have a dataGridView which has rows. Inside a row in dataGridView i kept two lines. For doing this i first did dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True; and kept a new line character in the string so if i have Mike and Bond to go in separate lines inside one row in dataGridView i would say "Mike"+"\n"+"Bond" it worked and kept in separate lines but when i double click on the DataGridView row for some weird reason its again keeping back in single line with some funny character between Mike and Bond But when i leave the row it again puts back in two separate lines. Did any body encountered this if yes how to solve this. I want them in Separate line always. Thanks Kal

    N 1 Reply Last reply
    0
    • K kalyanPaladugu

      Iam developing a windows application. I have a dataGridView which has rows. Inside a row in dataGridView i kept two lines. For doing this i first did dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True; and kept a new line character in the string so if i have Mike and Bond to go in separate lines inside one row in dataGridView i would say "Mike"+"\n"+"Bond" it worked and kept in separate lines but when i double click on the DataGridView row for some weird reason its again keeping back in single line with some funny character between Mike and Bond But when i leave the row it again puts back in two separate lines. Did any body encountered this if yes how to solve this. I want them in Separate line always. Thanks Kal

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

      Hello To solve this issue either use "Mark\r\nBond", or "Mark" + Environment.NewLine + "Bond" Regards:rose:

      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