Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
Vertical or Angled Alignment in ColumnHeader
posted

Hello,

We are in a situation where we have a large number of columns contained within our XamGrid.

In an attempt to reduce the horizontal real estate, we would like to try either using vertically aligned text (so that the column only needs to be as wide as the height of the text), or to have angled column headers (say between 30 to 45 degrees) so that the Column Header Text is more readable than being completely vertical, but again, the column width can be significantly reduced.

Is this something that is possible within the XamGrid?  If so, how can you go about doing this?

Thanks

Gary

Parents
  • 138253
    Offline posted

    Hello Gary,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style of the HeaderCellControl and handled the loaded event of a Grid in its Template, so I could be able to set the TextWrapping Property of the TextBlock that shows the header to Wrap. I also set the XamGrid’s HeaderRowHeight Property to dynamic. If you want an angled alignment you can retempalte the control as per your requirements. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamGridVerticalHeaders.zip
Reply Children