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. Visual Basic
  4. DataGrid Text Wrap

DataGrid Text Wrap

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
4 Posts 2 Posters 1 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.
  • B Offline
    B Offline
    betterc
    wrote on last edited by
    #1

    It seems there is a way to wrap text for a datagrid in .ASP and there is a way to wrap a header of a column. Does anybody know is there is a VB.NET way to wrap text in a column? Thanks, cb

    B 2 Replies Last reply
    0
    • B betterc

      It seems there is a way to wrap text for a datagrid in .ASP and there is a way to wrap a header of a column. Does anybody know is there is a VB.NET way to wrap text in a column? Thanks, cb

      B Offline
      B Offline
      Bernhard Hofmann
      wrote on last edited by
      #2

      I also need this functionality. I've written a custom word wrap function, but the height of each row doesn't grow to show the wrapped text. This seems to be a real nightmare! Don't worry, nobody lives forever.

      B 1 Reply Last reply
      0
      • B Bernhard Hofmann

        I also need this functionality. I've written a custom word wrap function, but the height of each row doesn't grow to show the wrapped text. This seems to be a real nightmare! Don't worry, nobody lives forever.

        B Offline
        B Offline
        Bernhard Hofmann
        wrote on last edited by
        #3

        It would appear that the best way tp do this would be to create a custom column class. Could anyone who's done this offer some help? I have a function that will do the word wrap based on a given width, font, and graphics object. Don't worry, nobody lives forever.

        1 Reply Last reply
        0
        • B betterc

          It seems there is a way to wrap text for a datagrid in .ASP and there is a way to wrap a header of a column. Does anybody know is there is a VB.NET way to wrap text in a column? Thanks, cb

          B Offline
          B Offline
          Bernhard Hofmann
          wrote on last edited by
          #4

          Hi I wrote a custom column style. The style only allows viewing, not editing. (Time is money, and money is something my client doesn't like parting with.) The main problem is that the column style needs to return the preferred, and minimum, width and height for it's contents BEFORE the paint operation takes place. I fiddled this by making a fixed height, and then the form housing the datagrid resizes the wrapped column so that the sum of the column widths equals the datagrid width. Too much code to include here, but you get the idea. Imperfect solution for an imperfect world. (Or is the world imperfect because people like me are willing to settle for less than perfection?) Don't worry, nobody lives forever.

          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