473,395 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

GridView Vertical Header Text and Sorting

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?

Sep 19 '07 #1
1 5554
On Sep 19, 3:54 pm, Kbalz <Kurtas.Balc...@gmail.comwrote:
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?

Sep 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben | last post by:
Hi, I'm wondering how can i change the datagrid header text at runtime so that it keeps the sorting enabled? I can do; e.Item.Cells.Text = "foo"; But then foo is the text of the table cell...
2
by: Arjen | last post by:
Hi, I get this error message when sorting a gridview: The GridView 'GridView1' fired event Sorting which wasn't handled What do I need to do? Thanks!
3
by: Hans Merkl | last post by:
Hi, I was wondering if it's possible to bind the header text of a GridView column to a method of an object I have. At the moment I am setting the header texts in Page_Load but I was wondering if...
1
by: Eric | last post by:
I have a GridView control that I want to sort on multiple columns when I click a particular column. For example, I display Last name + ", " + First name in the first column and display id in the...
8
by: fredd00 | last post by:
hi i'm trying to change the gridview columns header text the columns are not auto generated, i have set specific headertext values for each column i want to change the header text based on...
2
by: giveDsolution | last post by:
I want to sort the gridview by clicking the header but it shows the below error The GridView 'GridView1' fired event Sorting which wasn't handled.
1
by: ABHIJIT B | last post by:
Hi, I am using GridView in my web form and binding DataTable in code behind file as given below. gvUsersList.DataSource = dtUserList; gvUsersList.DataBind(); If no records exists in...
2
by: Mark B | last post by:
How can I put a linefeed in some header text (I am using the Datagrid control and editing the header properties for a field)? Average Sales Average Returns Average Sales ...
1
by: Amit00 | last post by:
Hi, I have an ascx file with a gridview, and I need to change the header text of the gridview's column in the code-behind. Something like that: foreach (DataControlField col in GridView1.Columns)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.