Solved

How to format datagrid caption?

Posted on 2006-11-02
5
1,302 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks ethoths.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

12 Experts available now in Live!

Get 1:1 Help Now