It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2006
Age: 40
Posts: 5
|
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 |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |