Rotated text in a datagrid

  • Thread starter Thread starter Jae
  • Start date Start date
Maybe this will help. You need to use a style.

<%@ Page Language="VB" Strict=True %>

<%@ import Namespace="System.Data" %>

<script language="VB" runat="server">
Sub Page_Load(byVal obj As Object, byVal e As EventArgs)
if not IsPostback
BindData()
end if
End Sub

sub BindData()
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
Dim i As Integer
For i = 0 To 9
dr = dt.NewRow()
dr(0) = "Item " & i.ToString()
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
os0.datasource = dv
os0.databind

End sub
</script>
<style>
..sideway { writing-mode:tb-rl}
</style>

<html>
<body>
<form runat="server">
<asp:DataList id="os0" repeatcolumns="2" repeatDirecttion="horizontal"
runat="server">
<ItemTemplate>
<asp:label class="sideway" text='<%#
(DataBinder.Eval(Container.DataItem, "StringValue")) %>' runat="server" />
</ItemTemplate>
</asp:DataList>

</form>
</body>
</html>
 
For a datagrid you will need to do something like this.

<%@ Page Language="VB" Strict=True %>

<%@ import Namespace="System.Data" %>

<script language="VB" runat="server">
Sub Page_Load(byVal obj As Object, byVal e As EventArgs)
if not IsPostback
BindData()
end if
End Sub

sub BindData()
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
Dim i As Integer
For i = 0 To 9
dr = dt.NewRow()
dr(0) = "<span class=" & chr(34) & "sideway" & chr(34) & ">Item
" & i.ToString() & "</span>"
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
os0.datasource = dv
os0.databind

End sub
</script>
<style>
..sideway { writing-mode:tb-rl}
</style>

<html>
<body>
<form runat="server">
<asp:DataGrid id="os0" runat="server">


<ItemStyle cssclass="sideway">
</ItemStyle>
<columns>
<asp:BoundColumn DataField="StringValue" />


</columns>
</asp:DataGrid>

</form>
</body>
</html>
 

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

Similar Threads

Need a dynamic Ad rotator. 2
Text Rotation in Word 2007 4
Rotating a Text Box. 2
Rotating a text box 1
Rotate Footer text? 0
Text Rotation 3
Rotate Image 1
TEXT - ROTATING 2

Back
Top