asp.net.ph

DetailsView.FieldHeaderStyle Property

System.Web.UI.WebControls Namespace   DetailsView Class


.NET Framework version 2.0

Sets or retrieves the style properties for the header columns in a DetailsView control.

Syntax


Script DetailsView.FieldHeaderStyle.Property [ = enumValue ]

Property Value

A TableItemStyle object that defines the style properties for the header columns in a DetailsView.

Remarks

Use this property to provide a custom style for the header columns in a DetailsView control. These are the columns that contain the field names of the data values.

Common style attributes that can be set include forecolor, backcolor, font, and content alignment within the cell. Providing different item styles enhances the appearance of the DetailsView control.

The FieldHeaderStyle subproperties can be set declaratively using either of the following methods:

  • Include an attribute in the opening tag of the DetailsView control in the form FieldHeaderStyle-Property
    <asp:detailsview ... 
       fieldheaderstyle-property=value
       ... >
    
    </asp:detailsview>
  • Include a <FieldHeaderStyle> element between the opening and closing tags of the DetailsView control
    <asp:detailsview ... >
    
       <fieldheaderstyle
          ... property definitions here />
    
    </asp:detailsview>

The subproperties can also be set programmatically in the form FieldHeaderStyle.Property.

For a list of style properties that can be set, see the TableItemStyle class.

Example

The below snippet shows setting the FieldHeaderStyle property of a DetailsView control at design time.

<asp:detailsview id = "msgView" runat = "server" cellpadding=5>

   <fieldheaderstyle
      backcolor = "maroon"
      forecolor = "khaki"
      font-bold font-italic />

</asp:detailsview>
See Also

DetailsView Members   EditRowStyle   FooterStyle   HeaderStyle   PagerStyle   RowStyle Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph