GridView Vertical Header Text and Sorting

K

Kbalz

Hello, my headerfields are wider than the datafields, so I wanted to
have my headerfields read vertically like:

| | S |
| | t |
| F | o |
| a | c |
| b | k |
--------
| Y | N |
| N | N |

So I used TemplateField's with HeaderTemplate and ItemTemplate like
this:

<asp:TemplateField SortExpression="Stocked">
<HeaderStyle VerticalAlign="Bottom" Width="15px" />
<HeaderTemplate>
S<br />t<br />o<br />c<br />k<br />e<br />d
</HeaderTemplate>
<ItemTemplate>
<%# Eval("Stocked")%>
</ItemTemplate>
</asp:TemplateField>

But I lose the ability to sort by this column!

How can I get the best of both worlds here? Sorting and Vertical
Headers?
 
K

Kbalz

Hello, my headerfields are wider than the datafields, so I wanted to
have my headerfields read vertically like:

| | S |
| | t |
| F | o |
| a | c |
| b | k |
--------
| Y | N |
| N | N |

So I used TemplateField's with HeaderTemplate and ItemTemplate like
this:

<asp:TemplateField SortExpression="Stocked">
<HeaderStyle VerticalAlign="Bottom" Width="15px" />
<HeaderTemplate>
S<br />t<br />o<br />c<br />k<br />e<br />d
</HeaderTemplate>
<ItemTemplate>
<%# Eval("Stocked")%>
</ItemTemplate>
</asp:TemplateField>

But I lose the ability to sort by this column!

How can I get the best of both worlds here? Sorting and Vertical
Headers?

I'm guessing not possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top