Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridView row height with wrapped text

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
0
0
US
Does anyone know how to determine the actual height of a row, at run time, in a DataGridView when text in one of the cells has caused a wrap?

I know that my grid has some rows with a wrapped text. Yet when I execute this: .Rows.Height it returns 20. That might be the programmed height, but it certainly isn't the actual height if there is wrapped text in one of the cells.

Thanks in advance,
Jerry

Jerry Scannell
 
What happens when you play with / change [tt]AutoSizeRowsMode[/tt] property?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
The row is autosizing correctly. That isn't the problem. I'm trying to resize the height of the grid based on the total of each row's height. The problem is that every row's height is 20 even if there is a cell with 2-3 lines of wrapped text.

Jerry


Jerry Scannell
 
Are you trying to resize the height of the entire DataGridView control depending on the number and height of the rows? In other words, eliminate vertical scrollbars?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top