Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

12.3. Customizing the Appearance of the Data Controls

By default, the GridView and DetailsView render columns or rows automatically based on the data they receive. Alternatively, you can have VWD create a number of fields or columns for you when you attach the control to a data source. But, more often than not, you want to change what you see on screen, be it fewer columns, different column headings, or different controls to display data. Fortunately, this is really easy to do with the Fields editor in VWD. In the next section you see how to use this editor to create and modify the different types of built-in columns and fields. In the section that follows, you see how to customize the fields even further with user-defined templates.

12.3.1. Configuring Columns or Fields of Data-Bound Controls

Within the <Columns> or <Fields> element of the GridView and the DetailsView, you can add the types of fields shown in the following table.

Field TypeDescription
BoundFieldThis is the default field for most data base types. It renders as simple text in read-only mode, and as a TextBox in edit mode.
ButtonFieldThis type renders as a link or a button allowing you to execute a command on the server.
CheckBoxFieldThis type renders as a read-only checkbox in read-only mode, and as an editable checkbox in edit mode.
CommandFieldThis type enables you to set up various commands, including editing, inserting, updating, and deleting.
HyperLinkFieldThis type renders as a link (an <a> element). You can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book