rpm
asked on
GridView vertical column headings without breaking the sort functionality
I have a GridVIew table in an ASP.net 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:
<style>
.verticaltext
{
writing-mode: vertical-rl;
}
</style>
2) Adding the following into gvResults_DataBound:
For C = 2 To 16
gvResults.HeaderRow.Cells( C).Text = "<div class=""verticaltext"">" & gvResults.Columns(C).Heade rText & "</div>"
Next
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.
Thanks,
Richard
I have achieved this with the following steps:
1) Adding the following into the head:
<style>
.verticaltext
{
writing-mode: vertical-rl;
}
</style>
2) Adding the following into gvResults_DataBound:
For C = 2 To 16
gvResults.HeaderRow.Cells(
Next
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.
Thanks,
Richard
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
<ItemStyle CssClass="mystyle" />
with css
.mystyle
{vertical-align: <something here>}
OR
<asp:TemplateField ItemStyle-VerticalAlign=".