Solved

VB.net RowHeight and Word Wrap

Posted on 2012-04-09
4
1,473 Views
Last Modified: 2012-04-14
Hi

How do I set this for all sells in a DataGridView row. I need to make sure that if I have long text in a cell that it wraps and is all visible
0
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 17

Accepted Solution

by:
nepaluz earned 500 total points
ID: 37827942
1. For wordwrap, you use the wrapmode of the cellstyle, e.g for the entire grid use:
Me.dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True

Open in new window

or you can apply the cellstyle to individual collections of cells, columns, rows etc
Here's a good resource from MSDN on datagridview formating http://msdn.microsoft.com/en-us/library/f9x2790s.aspx
2. For RowHeight, simple call set the height by
Dim row As DataGridViewRow = DataGridView1.Rows(0)
row.Height = 15

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37833050
I am being evil BuggyCoder

Your first link is for ASP.NET gridview (question is for winforms datagridview)
Your second link is for RadGrid which is a 3rd party control

:-)
0
 

Author Closing Comment

by:murbro
ID: 37846087
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question