Solved

How to format datagrid caption?

Posted on 2006-11-02
5
1,337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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