How can I add Caption/Title to GridView? - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > .NET » How can I add Caption/Title to GridView?


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 07-06-2006   #1 (permalink)
bradley
Junior Member
 
Join Date: Jul 2006
Age: 40
Posts: 5
Default How can I add Caption/Title to GridView?

Have you ever wanted to add a Title or Caption to your GridView (i.e. at the top of your GridView control)? Some of you may already be aware of the GridView.Caption property, but entering your caption text displays a simple text rather than being able to define styles like other GridView elements. Well, I think there is a way to get around this limitation.
While trying to answer one of the post about GridView.Caption property, I realized that you can assign a full HTML rather than a simple text. This means that you can be creative in designing what your caption looks like. Following simple example illustrates using some HTML tags to define the border and background color to the caption area:
<asp:GridView ID="GridView1" runat="server" ...
Caption='<table border="1" width="100%" cellpadding="0" cellspacing="0" bgcolor="yellow"><tr><td>Grid Heading</td></tr></table>'
CaptionAlign="Top">
What this does is to insert a Table that fills the Caption region (width="100%" ensures same width as that of the GridView) while using Yellow background color. What's more, it opens the door to adding captions that are limited only by your imagination. Happy coding.

Bradley
bradley is offline   Reply With Quote


Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO: Using sorting / paging on GridView w/o a DataSourceControl DataSource preston .NET 1 07-08-2006 03:26 AM
Custom Title. Syotica All Things General 0 03-07-2006 04:09 AM
Main Title Help Please Chewy Forum Management 6 10-23-2005 01:07 AM
Change My Member Title Change Buy, Sell or Trade 2 09-10-2005 11:25 PM


footer left
All times are GMT. The time now is 12:43 AM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Mortgages | Bad Credit Mortgages | Loan | Remortgages | Remortgages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49