asp.net.ph

GridView.HeaderRow Property

System.Web.UI.WebControls Namespace   GridView Class


.NET Framework version 2.0

Returns a GridViewRow object that represents the header row displayed at the top of the GridView control.

Syntax


Script [ GridViewRow variable = ] GridView.HeaderRow

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


variable A GridViewRow object that represents the header row of the GridView control.

The property is read only with no default value.

Remarks

The header row is displayed at the top of the GridView control when the HeaderText or HeaderTemplate property is set. Use the HeaderRow property to programmatically access the GridViewRow object that represents the header row.

NOTE: The HeaderRow property is available only after the GridView control creates the header row in the ItemCreated event.

This property is commonly used when you need to programmatically manipulate the header row, for example when adding custom content. Any modification to the HeaderRow property must be performed after the GridViewRow object that represents the header row has been created; otherwise, the GridView control overwrites any changes.

To control the style of the header row, use the HeaderStyle property.

Example

The following example demonstrates how to programmatically set the style properties of the HeaderRow in a GridView control at run time.

 Show me 

See Also

GridViewRow   BottomPagerRow   FooterRow   TopPagerRow 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