System.Web.UI.WebControls Namespace GridView Class
.NET Framework version 2.0
Returns a GridViewRow object that represents the pager row displayed at the top of the GridView control.
Script |
[ GridViewRow variable = ] GridView.TopPagerRow |
The property is read only with no default value.
When paging is enabled ( when the AllowPaging property is set to true ), an additional row called the pager row is automatically displayed in the GridView control.
The pager row contains controls that allow the user to navigate to other records, and can be displayed at the top, the bottom, or both the top and bottom of the control. Use the TopPagerRow property to programmatically access the GridViewRow object that represents the top pager row in the GridView control.
NOTE: The TopPagerRow property is available only after the GridView control creates the top pager row in the ItemCreated event.
This property is commonly used when you need to programmatically manipulate the top pager row, for example when adding custom content. Any modification to the TopPagerRow property must be performed after the GridViewRow object that represents the top pager row has been created; otherwise, the GridView control overwrites any changes.
The following example demonstrates how to programmatically set the style properties of the TopPagerRow in the GridView control at run time.
void chgSelectedProps ( Object src, EventArgs e ) {
if ( myGridView.TopPagerRow != null ) {
myGridView.TopPagerRow.BackColor = System.Drawing.Color.Khaki;
myGridView.TopPagerRow.ForeColor = System.Drawing.Color.Maroon;
myGridView.TopPagerRow.Font-Bold = true;
}
}
Sub chgSelectedProps ( src As Object, e As EventArgs )
If Not ( myGridView.TopPagerRow Is Nothing ) Then
myGridView.TopPagerRow.BackColor = System.Drawing.Color.Khaki
myGridView.TopPagerRow.ForeColor = System.Drawing.Color.Maroon
myGridView.TopPagerRow.Font-Bold = True
End If
End Sub |
|
C# |
VB |
GridViewRow BottomPagerRow FooterRow HeaderRow Row