System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Sets or retrieves the style properties of an empty data row when the data source bound to a FormView control returns empty, or contains no data.
Script |
FormView.EmptyDataRowStyle.Property [ = enumValue ] |
A TableItemStyle object that defines the style properties for an empty data row in a FormView.
Use this property to provide a custom style for an empty data row in a FormView 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 FormView control.
The EmptyDataRowStyle subproperties can be set declaratively using either of the following methods:
The subproperties can also be set programmatically in the form EmptyDataRowStyle.Property.
For a list of style properties that can be set, see the TableItemStyle class.
The below snippet shows how to set the EmptyDataRowStyle for a FormView control at design time.
<asp:formview id = "msgView" runat = "server" ... >
<headerstyle backcolor = "steelblue"
forecolor = "beige" />
<rowstyle verticalalign = "top" />
<emptydatarowstyle backcolor = "lightgreen" />
<itemtemplate>
...
</itemtemplate>
</asp:formview>
EditRowStyle InsertRowStyle RowStyle