Solved

How to format datagrid caption?

Posted on 2006-11-02
5
1,321 Views
Last Modified: 2008-03-04
Hi,

How do I format the caption of a datagrid? I want to make it bold or show it in a different color.

I am setting it like this.

datagrid1.Caption = "My Datagrid Caption";

Thank you.

0
Comment
Question by:engg
  • 2
  • 2
5 Comments
 
LVL 11

Assisted Solution

by:ethoths
ethoths earned 500 total points
ID: 17861195
Bay far the simplist way is...

datagrid1.Caption = "<b>My Datagrid Caption</b>";


I'm sure there are other ways but this will way and why make life difficult?
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 17861217
You mean caption for datagrid column? If it is so, you can set the style from DataGrid Property Builder (Right click on DG, select Property Builder from the menu)

--Nauman.
0
 

Author Comment

by:engg
ID: 17861867
Thanks ethoths, your solution worked.
So I will have to use HTML to format it? e.g. if I want to change its color, font etc.
Could you name the other ways of doing it?

Thanks nauman_ahmed. No, I am talking about the 'Caption' property of the datagrid itself.
0
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
ID: 17866987
Not really as the datagrid.caption does not appear to have many properties.

A slightly less messy way of doing it would be...

datagrid1.Caption = "<span class="MyDataGridCaption">My Datagrid Caption</span>";


Then in the Head of the HTML...

<style type="text/css">
  .MyDataGridCaption
  {
    font-weight:bold;
    color:red;
    etc...
  }
</style>

This allows you to set the css in a style island rather than the caption itself.
0
 

Author Comment

by:engg
ID: 17890953
Thanks ethoths.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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…

776 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