Solved

Set DataGrid header text to show vertically

Posted on 2006-11-17
4
864 Views
Last Modified: 2008-02-01
I have an ASP.NET 1.1 application that will have a large-ish number of users completing a series of educational modules.  At the end of each module the user completes a multiple choice test.
I'm trying to figure out what the best way is to display which users completed which module tests.  I thought that a DataGrid would work relatively well by having a list of users down the left side of the DG, and the names of the modules across the top.  If User "Smith" completed module test "VAP", then the DataGrid cell at that "coordinate" would be filled with a solid colour.  Any module tests not completed would remain empty.

My question (after all of that), is how can orient the names of the modules across the top of the DG (i.e. the headers) vertically (or at an angle), in order to use space as effeciently as possible?

Thanks
0
Comment
Question by:tmccrank
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:ibost
ID: 17967905
I would create a "false" header row... i.e. a table above the datagrid with columns set to the same width as the datagrid's columns.  Then in the datagrid set ShowHeader=false

I could be wrong but I don't think a datagrid will support rotating the text 90 degrees.
0
 
LVL 10

Accepted Solution

by:
ibost earned 250 total points
ID: 17968043
Ahh i found a possible solution:

Before you call DataBind()

Add a line like this for each column you want vertical:
MyDataGrid.Columns[1].HeaderText = "<DIV STYLE=\"writing-mode:tb-rl\">My Header</DIV>";
0
 

Author Comment

by:tmccrank
ID: 17969442
Interesting, thanks ibost.  I won't be able to try it out for a little while, but I'll get back to you asap.
0
 

Author Comment

by:tmccrank
ID: 18115620
Sorry for leaving this so long ibost, I was distracted by a couple of things that took me away from this project.  Unfortunately, this is still the case so I haven't had a chance to test your code.  Nevertheless, I appreciate your input, I hope to give it a shot fairly soon.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question