How to stretch Colum header in WPF datagrid?
-
Hi, guys! I'm having a bit of a trouble with my columns' headers in WPF Datagrid. Some of them are too long, and horizontal stratching is not an option: there are too many of columns, and user will not be able to see full text in headers. Here is what I'd like to do I want header "Word1 word2 word3 word4 word5 word6" to look like "Word1 word2 word3 word4 word5 word6" - so it srteches vertically. Thanks in advance
-
Hi, guys! I'm having a bit of a trouble with my columns' headers in WPF Datagrid. Some of them are too long, and horizontal stratching is not an option: there are too many of columns, and user will not be able to see full text in headers. Here is what I'd like to do I want header "Word1 word2 word3 word4 word5 word6" to look like "Word1 word2 word3 word4 word5 word6" - so it srteches vertically. Thanks in advance
I haven't tried it, but I should imagine that all you need to do is set a style with a
TargetType
oftk:DataGridColumnHeader
, and set theTextWrapping
in there."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.