Solved

How to format datagrid caption?

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 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