Auto sizing cell height on word wrap

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
IanUoY
Posts: 62
Joined: Wed Jul 31, 2013 2:09 am

Auto sizing cell height on word wrap

Post by IanUoY » Thu Dec 07, 2017 5:45 am

v5.4.145
64-bit

Ok, I cannot get cells with text displayed in a datagridview to increase the size of the cell to accommodate the text when word wrap set to true.
The really bizarre thing is that I have other forms where it does seem to work (and I cannot for the life of me see any difference in setup). It is a two columned datagridview with 1 column hidden.

Any help most appreciated.

Thanks

User avatar
IanUoY
Posts: 62
Joined: Wed Jul 31, 2013 2:09 am

Re: Auto sizing cell height on word wrap

Post by IanUoY » Thu Dec 07, 2017 7:35 am

Managed to get working, by adding :

$dgvCourseRoutes.AutoResizeRows()

after I'd populated the rows.

Although I did not do this in the script for the previous form(s) which did work.

Ian

User avatar
Alexander Riedel
Posts: 6434
Joined: Tue May 29, 2007 4:43 pm

Re: Auto sizing cell height on word wrap

Post by Alexander Riedel » Tue Dec 19, 2017 9:33 am

Moved to correct forum by moderator
Alexander Riedel
SAPIEN Technologies, Inc.

Locked