System.Web.UI.WebControls Namespace DetailsView Class
.NET Framework version 2.0
Sets or retrieves the style properties for the individual rows in a DetailsView control.
Script |
DetailsView.RowStyle.Property [ = enumValue ] |
A TableItemStyle object that defines the style properties for the individual rows in a DetailsView.
Use this property to provide a custom style for the individual rows in a DetailsView control. Common style attributes that can be set include forecolor, backcolor, font, and content alignment within the cell. Providing different row styles enhances the appearance of the DetailsView control.
The RowStyle subproperties can be set declaratively using either of the following methods:
The subproperties can also be set programmatically in the form RowStyle.Property.
For a list of style properties that can be set, see the TableItemStyle class.
The below snippet shows how to set the RowStyle for a DetailsView control at design time.
<asp:detailsview id = "msgView" runat = "server"
cellpadding=5>
<headerstyle
backcolor = "navy"
forecolor = "lime"
font-bold />
<rowstyle
backcolor = "beige"
font-name = "Bookman Old Style"
font-size = "11pt" font-bold font-italic />
</asp:detailsview>
DetailsView Members EditRowStyle EmptyDataRowStyle InsertRowStyle