Solved

How to format datagrid caption?

Posted on 2006-11-02
5
1,312 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now