Vertical text IN Gridview
Hi Im trying to display the header text of the columns vertically(rotated counter-clockwise 90degrees). I first tried using CSS writing-mode: tb-rl and filter: flipH() flipV() but that seems to only work on tables and not gridviews.
Is there a way I can get a GridView HeaderColumn text to display rotated 90 degrees counter-clockwise? Please help if you can. Thanks.
Eric
[394 byte] By [
eseidel] at [2008-2-13]
Well I just figured it out on my own after playing around with it for a while. I am writing this to share with anyone else who may also need to rotate text in a gridview. I am only rotating text in the header row, but this should work for all cells in the gridview if needed.
I am using an external style sheet for my .aspx page ith the following as one of the styles:
.verticaltext
{
font:bold 10px Tahoma;color: #0000FF;writing-mode: tb-rl;filter: flipH() flipV();}
So what I am doing is loading my gridview like usual, and then adding a _DataBound event for the gridview. So here is the code to rotate the header row.
Protected Sub gvMatrix_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvMatrix.DataBoundDim
style As New Web.UI.WebControls.StyleDim row As GridViewRow = gvMatrix.HeaderRowstyle.CssClass =
"verticaltext"For Each cell As TableCell In row.Cellscell.ApplyStyle(style)
Nextend sub
I hope this helps
Eric