Rotated text in a datagrid

Discussion in 'ASP .Net' started by Jae, Nov 21, 2003.

  1. Jae

    Jae Guest

    Jae, Nov 21, 2003
    #1
    1. Advertising

  2. Jae

    vMike Guest

    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>


    "Jae" <> wrote in message
    news:...
    > Does anyone know of a way to rotate text in a datagrid?
    >
    > I have tried this :
    >

    http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/writingMode.htm
    > but this technique did not work for me.
    >
    > I can create a Drawing.Image.Graphic but once you do that how do you add

    the
    > image to the page? Any help would be greatly appreciated
    >
    > Jae
     
    vMike, Nov 21, 2003
    #2
    1. Advertising

  3. Jae

    vMike Guest

    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>


    "Jae" <> wrote in message
    news:...
    > Does anyone know of a way to rotate text in a datagrid?
    >
    > I have tried this :
    >

    http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/writingMode.htm
    > but this technique did not work for me.
    >
    > I can create a Drawing.Image.Graphic but once you do that how do you add

    the
    > image to the page? Any help would be greatly appreciated
    >
    > Jae
     
    vMike, Nov 22, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msorion
    Replies:
    5
    Views:
    2,828
    Jacqui or (maybe) Pete
    Jul 22, 2003
  2. Eric Apperley

    Tkinter - Drawing rotated text in a widget

    Eric Apperley, Mar 12, 2006, in forum: Python
    Replies:
    1
    Views:
    1,373
    Cameron Laird
    Mar 12, 2006
  3. thedarkman

    rotated text - problem solved

    thedarkman, Oct 16, 2010, in forum: HTML
    Replies:
    24
    Views:
    1,301
    Hugues
    Oct 27, 2010
  4. thedarkman

    rotated text - problem solved

    thedarkman, Oct 16, 2010, in forum: HTML
    Replies:
    1
    Views:
    585
    dorayme
    Oct 16, 2010
  5. go_to

    rotated text

    go_to, Nov 26, 2004, in forum: Javascript
    Replies:
    0
    Views:
    102
    go_to
    Nov 26, 2004
Loading...

Share This Page