[RESOLVED] How to Wrap Cell Content in Datagrid?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: [RESOLVED] How to Wrap Cell Content in Datagrid?

  1. #1
    Join Date
    Jul 2011
    Posts
    9

    [RESOLVED] How to Wrap Cell Content in Datagrid?

    Since some of the cells have long contents, I want to wrap the cell content. As a result, the content of the cell will be displayed in two layers form. So, user doesn't have to scroll horizontally. Can anyone teach me?

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,953

    Re: How to Wrap Cell Content in Datagrid?

    Depends on what you need to wrap. You can calculate the MAX width of EVERY column, before drawing the grid...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2011
    Posts
    9

    Re: How to Wrap Cell Content in Datagrid?

    And then, how can I put the rest of the content under the upper content in the same cell?

  4. #4
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,813

    Re: How to Wrap Cell Content in Datagrid?

    Set the dbgrid.columns(index).WrapText=true
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jul 2011
    Posts
    9

    Re: How to Wrap Cell Content in Datagrid?

    Thanks a lot. It really helpful. =)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center