Solved

VB.net RowHeight and Word Wrap

Posted on 2012-04-09
4
1,399 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
4 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37825332
0
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call an IPL program from vb.net and pass in a file location parmeter 2 20
VB.NET 2008 Publish Error 2 27
Expression Evaluater 3 25
VB.NET 2008 - SQL Timeout 9 24
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

778 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