Thursday, September 15, 2011

GridView Vertical text in headers

http://forums.asp.net/t/1049758.aspx/1




.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.DataBound

Dim style As New Web.UI.WebControls.Style

Dim row As GridViewRow = gvMatrix.HeaderRow

style.CssClass = "verticaltext"

For Each cell As TableCell In row.Cells

cell.ApplyStyle(style)

Next

end sub

No comments:

Post a Comment