GridView vertical column headings without breaking the sort functionality

rpm used Ask the Experts™
I have a GridVIew table in an project. I need the column headings to be oriented vertically.

I have achieved this with the following steps:

1) Adding the following into the head:

            writing-mode: vertical-rl;

2) Adding the following into gvResults_DataBound:

For C = 2 To 16
      gvResults.HeaderRow.Cells(C).Text = "<div class=""verticaltext"">" & gvResults.Columns(C).HeaderText & "</div>"

This has the required visual effect, but unfortunately breaks the ability to click the column heading to sort the table.

Can anyone suggest a way to re-orient the header text without breaking the sort functionality.


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
It's been a while since I've used Gridviews but can you use

      <ItemStyle  CssClass="mystyle" />

with css
{vertical-align: <something here>}


<asp:TemplateField ItemStyle-VerticalAlign="....."

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial