473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotated text in a datagrid

Jae
Does anyone know of a way to rotate text in a datagrid?

I have tried this :
http://msdn.microsoft.com/workshop/s...ritingMode.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
Nov 18 '05 #1
2 2074
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" <ak*********@earthlink.net> wrote in message
news:22**************************@posting.google.c om...
Does anyone know of a way to rotate text in a datagrid?

I have tried this :
http://msdn.microsoft.com/workshop/s...ritingMode.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

Nov 18 '05 #2
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" <ak*********@earthlink.net> wrote in message
news:22**************************@posting.google.c om...
Does anyone know of a way to rotate text in a datagrid?

I have tried this :
http://msdn.microsoft.com/workshop/s...ritingMode.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

Nov 18 '05 #3

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

Similar topics

6
8493
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black...
6
61721
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e)...
1
2164
by: kurt sune | last post by:
I am trying to do a rotated font. I get a handle alright which I convert to a font-object by Font2 = Font.FromHfont(handleFont) g.DrawString(Text-to draw, Font2, Brush, CurrentX, CurrentY) ...
1
7733
by: Eric Apperley | last post by:
How do I draw rotated text in a Tkinter widget using the draw.text method? Alternatively, if I draw text as normal, how can I then subsequently rotate it about its start point?
2
5773
by: Tilo Pätzold | last post by:
Hi Everybody (especially Microsoft), we build EMF files with rotated text for export to office (powerpoint, word). It is planned that the text can be edited in the office document. Without the...
0
1720
by: Khadim | last post by:
Hi, I am facing a problem in my application. I have an image on which there are many numbers present. I can find the pixel position of the center of those numbers. Now I have the names of those...
5
64199
by: austincollins | last post by:
I have been searching for hours to find a solution to display text rotated at 90 degrees in firefox, and could not find one. css3 and IE has the css command "writing-mode: tb-rl;" but this does not...
7
2166
by: halo combat22 | last post by:
I need help on a project i was assigned. I need a way to recognize these numbers. Any help is appreciated.
0
7344
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
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
441
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.