Solved

VB.net RowHeight and Word Wrap

Posted on 2012-04-09
4
1,338 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now