469,938 Members | 2,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Gridview: can column contents be programmatically styled?

I'm wondering if it's possible, outside of the declaration of an ASP.NET 2.0
GridView, to programmatically style individual columns. For example, I might
want to make the text in a particular column bold, or larger.

I know that Templates and other declarative mechanisms exist to make this
happen. I'm wondering if you can apply the styling using code only. What is
the general syntax?

Flash Actionscript has this "after the fact" programmatic styling, and it
comes in handy.

-KF
Nov 19 '05 #1
1 2032
Hi KF,

Welcome to ASPNET newsgroup.
As for the applying style for the GridView's Columns, of course they can be
done statically through aspx template or programmatically through code. The
GridView Control has a Columns property which contains all the
columns(Fields) defined for it. We can access them through index, then each
column(field) has the ControlStyle property which can be used to configure
UI style for individual columns.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| Reply-To: "ke*****@nospam.nospam" <ke*****@u.washington.edu>
| From: <ke*****@nospam.nospam>
| Subject: Gridview: can column contents be programmatically styled?
| Date: Mon, 15 Aug 2005 10:15:38 -0700
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <eo**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: idea.urel.washington.edu 128.95.9.12
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118043
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm wondering if it's possible, outside of the declaration of an ASP.NET
2.0
| GridView, to programmatically style individual columns. For example, I
might
| want to make the text in a particular column bold, or larger.
|
| I know that Templates and other declarative mechanisms exist to make this
| happen. I'm wondering if you can apply the styling using code only. What
is
| the general syntax?
|
| Flash Actionscript has this "after the fact" programmatic styling, and it
| comes in handy.
|
| -KF
|
|
|

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mark Parter | last post: by
2 posts views Thread by Philip | last post: by
reply views Thread by cook.jonathan.m | last post: by
5 posts views Thread by NKaufman | last post: by
10 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
2 posts views Thread by =?Utf-8?B?SkRSYXZlbg==?= | last post: by
2 posts views Thread by John Straumann | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.