Welcome Guest Search | Active Topics | Sign In | Register

text orientation in grid Options
Justin S
Posted: Tuesday, April 15, 2008 7:24:18 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2008
Posts: 4
I am looking for a grid where i can rotate the header text to where it would be vertical. can the essential objects grid do such a thing?
eo_support
Posted: Tuesday, April 15, 2008 7:49:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi Justin,

It doesn't have too much to do with the Grid. It has to do with CSS and standard HTML. In IE 5.5 and above, you can use the following CSS attribute to make text vertical:

layout-flow: vertical-ideographic

For example:

Code: HTML/ASPX
<div style="layout-flow: vertical-ideographic">vertical text</div>


You can apply this attribute to the Grid's ColumnHeaderStyle/ColumnHeaderHoverStyle to make the header text vertical (manually append "layout-flow: vertical-ideographic" to the end of the CssText property, which should already have some other attributes) . However this only works on IE.

You can use a more cumbersome, but cross browser way to render vertical text --- which is literally break each letter into a new line. Such as:

Code: HTML/ASPX
t<br />
e<br />
x<br />
t


This way you will set the column header's Text to such HTML text. This works well if you column header text is static, otherwise you will need to write some code to convert plain text to such HTML code. You can try out this by going to the Grid Builder, select a column and then change the column's HeaderText property to such HTML text, you will see the text becomes vertical immediately from the preview tab.

Once you started to use vertical header text, most likely you will also need to adjust the Grid's ColumnHeaderHeight property along with several other properties that provides the background image for the Grid because the column header's height will be bigger. You can find more information on how to customize the Grid's header appearance at here:

http://www.essentialobjects.com/ViewDoc.aspx?t=Grid%2fstyling.html

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks
Justin S
Posted: Tuesday, April 15, 2008 7:59:45 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2008
Posts: 4
what if you want to have it at a certain angle? 75 degrees for example
eo_support
Posted: Tuesday, April 15, 2008 8:01:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Use images. :)
Justin S
Posted: Tuesday, April 15, 2008 8:03:57 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2008
Posts: 4
but how well would that work when i want to export my grid to excel?
eo_support
Posted: Tuesday, April 15, 2008 8:08:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

You never export the "Grid" to excel. You export your data to excel. So in a way both the Grid and the excel file are filled/generated from your data source, which also means there is no direct relationship between the Grid and your excel file. That means how your implement vertical text has nothing to do with how you export the excel file.

Hope that clears up.

Thanks
Justin S
Posted: Tuesday, April 15, 2008 8:12:15 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2008
Posts: 4
Sorry I was used to native gridview control where i can export the gridview and it picks up all the formatting that i applied to the gridview.
eo_support
Posted: Tuesday, April 15, 2008 8:24:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

That won't work with our Grid because our Grid requires JavaScript to function. When you export a native GridView to excel, you basically dump the same HTML that the GridView generated for the browser to an excel file. That works fine without JavaScript but will never work if the control relies on JavaScript to function.

With our Grid the Grid and the excel file (or whatever other files you want to generate) are unrelated. It's like you draw a pie chart and a bar chart from the same data source and how to draw one chart absolutely has nothing to do with how you do the other. The easiest way for you to get both is to use our Grid to display and use the native GridView to export. Sorry about that!

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.