'Rotate all headers in WinGrid horizontally 45 degrees. Me.CustomersUltraGrid.DisplayLayout.Override.ColumnHeaderTextOrientation = _ Infragistics.Win.TextOrientationInfo.Horizontal45Degrees
WinGrid™ column headers help your end user identify exactly what it is that they are looking at. Column headers can be very descriptive and very long. In several cases, the text in your column headers may be much longer than the text in the actual column (especially when using numeric data). In order to shorten the column width despite a lengthy column header, you can rotate the column header until the column is a more suitable width.
You can rotate column headers on WinGrid’s Override, Band, and Column levels, as well as group headers. For the most part, setting the text orientation for a specific object involves setting a TextOrientation property to an instance of the TextOrientationInfo object. The TextOrientationInfo object exposes several properties which return predefined TextOrientationInfo objects. These predefined objects rotate column header text in common rotations and are provided for your convenience. You can rotate column headers with the following predefined TextOrientationInfo objects:
Horizontal45Degrees – Rotates column headers horizontally by 45 degrees.
Horizontal90Degrees — Rotates column headers horizontally by 90 degrees.
HorizontalNegative45Degrees — Rotates column headers horizontally by -45 degrees.
HorizontalNegative90Degrees — Rotates column headers horizontally by -90 degrees.
Vertical — Rotates column headers horizontally by 90 degrees.
Horizontal — No rotation.
In Visual Basic:
'Rotate all headers in WinGrid horizontally 45 degrees. Me.CustomersUltraGrid.DisplayLayout.Override.ColumnHeaderTextOrientation = _ Infragistics.Win.TextOrientationInfo.Horizontal45Degrees
In C#:
//Rotate all headers in WinGrid horizontally 45 degrees. this.customersUltraGrid.DisplayLayout.Override.ColumnHeaderTextOrientation = Infragistics.Win.TextOrientationInfo.Horizontal45Degrees;
Of course, if these predefined rotations don’t work out, you can always instantiate a new TextOrientationInfo object with your own rotation. The only stipulation is that you can’t rotate header text vertically.
In Visual Basic:
'Rotate all headers in WinGrid by 75 degrees. Me.CustomersUltraGrid.DisplayLayout.Override.ColumnHeaderTextOrientation = _ New Infragistics.Win.TextOrientationInfo _ (75, Infragistics.Win.TextFlowDirection.Horizontal)
In C#:
//Rotate all headers in WinGrid by 75 degrees. this.customersUltraGrid.DisplayLayout.Override.ColumnHeaderTextOrientation = new Infragistics.Win.TextOrientationInfo (75, Infragistics.Win.TextFlowDirection.Horizontal);
Once you’ve figured out how you want to rotate your header text, you need to identify on which level you want to rotate your header text. Refer to the following table to figure out which property you need to set to an instance of TextOrientationInfo in order to rotate the proper header text.