.NET Framework Class Library TableHeaderRow Class Represents a heading row in a Table control.

Inheritance Hierarchy
Namespace:
System.Web.UI.WebControls
Assembly:
System.Web (in System.Web.dll)

Syntax
Public Class TableHeaderRow _
Inherits TableRow
public class TableHeaderRow : TableRow
public ref class TableHeaderRow : public TableRow
type TableHeaderRow =
class
inherit TableRow
end
The TableHeaderRow type exposes the following members.

Constructors
|
| Name | Description |
|---|
.gif) | TableHeaderRow | Initializes a new instance of the TableHeaderRow class. | Top

Methods
|
| Name | Description |
|---|
.gif) | AddAttributesToRender | Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | AddedControl | Called after a child control is added to the Controls collection of the Control object. (Inherited from Control.) | .gif) | AddParsedSubObject | Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object. (Inherited from Control.) | .gif) | ApplyStyle | Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. This method is primarily used by control developers. (Inherited from WebControl.) | .gif) | ApplyStyleSheetSkin | Applies the style properties defined in the page style sheet to the control. (Inherited from Control.) | .gif) | BuildProfileTree | Infrastructure. Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page. (Inherited from Control.) | .gif) | ClearCachedClientID | Infrastructure. Sets the cached ClientID value to nullNothingnullptra null reference (Nothing in Visual Basic). (Inherited from Control.) | .gif) | ClearChildControlState | Deletes the control-state information for the server control's child controls. (Inherited from Control.) | .gif) | ClearChildState | Deletes the view-state and control-state information for all the server control's child controls. (Inherited from Control.) | .gif) | ClearChildViewState | Deletes the view-state information for all the server control's child controls. (Inherited from Control.) | .gif) | ClearEffectiveClientIDMode | Infrastructure. Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Inherited from Control.) | .gif) | CopyBaseAttributes | Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | CreateChildControls | Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. (Inherited from Control.) | .gif) | CreateControlCollection | Creates a new ControlCollection object for the TableRow control. (Inherited from TableRow.) | .gif) | CreateControlStyle | Creates a TableItemStyle object for the TableRow control. (Inherited from TableRow.) | .gif) | DataBind()()() | Binds a data source to the invoked server control and all its child controls. (Inherited from Control.) | .gif) | DataBind(Boolean) | Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event. (Inherited from Control.) | .gif) | DataBindChildren | Binds a data source to the server control's child controls. (Inherited from Control.) | .gif) | Dispose | Enables a server control to perform final clean up before it is released from memory. (Inherited from Control.) | .gif) | EnsureChildControls | Determines whether the server control contains child controls. If it does not, it creates child controls. (Inherited from Control.) | .gif) | EnsureID | Creates an identifier for controls that do not have an identifier assigned. (Inherited from Control.) | .gif) | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | .gif) | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | .gif) | FindControl(String) | Searches the current naming container for a server control with the specified id parameter. (Inherited from Control.) | .gif) | FindControl(String, Int32) | Infrastructure. Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method. (Inherited from Control.) | .gif) | Focus | Sets input focus to a control. (Inherited from Control.) | .gif) | GetDesignModeState | Infrastructure. Gets design-time data for a control. (Inherited from Control.) | .gif) | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | .gif) | GetRouteUrl(Object) | Gets the URL that corresponds to a set of route parameters. (Inherited from Control.) | .gif) | GetRouteUrl(RouteValueDictionary) | Gets the URL that corresponds to a set of route parameters. (Inherited from Control.) | .gif) | GetRouteUrl(String, Object) | Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.) | .gif) | GetRouteUrl(String, RouteValueDictionary) | Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.) | .gif) | GetType | Gets the Type of the current instance. (Inherited from Object.) | .gif) | GetUniqueIDRelativeTo | Returns the prefixed portion of the UniqueID property of the specified control. (Inherited from Control.) | .gif) | HasControls | Determines if the server control contains any child controls. (Inherited from Control.) | .gif) | HasEvents | Returns a value indicating whether events are registered for the control or any child controls. (Inherited from Control.) | .gif) | IsLiteralContent | Infrastructure. Determines if the server control holds only literal content. (Inherited from Control.) | .gif) | LoadControlState | Restores control-state information from a previous page request that was saved by the SaveControlState method. (Inherited from Control.) | .gif) | LoadViewState | Restores view-state information from a previous request that was saved with the SaveViewState method. (Inherited from WebControl.) | .gif) | MapPathSecure | Retrieves the physical path that a virtual path, either absolute or relative, maps to. (Inherited from Control.) | .gif) | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | .gif) | MergeStyle | Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | OnBubbleEvent | Determines whether the event for the server control is passed up the page's UI server control hierarchy. (Inherited from Control.) | .gif) | OnDataBinding | Raises the DataBinding event. (Inherited from Control.) | .gif) | OnInit | Raises the Init event. (Inherited from Control.) | .gif) | OnLoad | Raises the Load event. (Inherited from Control.) | .gif) | OnPreRender | Raises the PreRender event. (Inherited from Control.) | .gif) | OnUnload | Raises the Unload event. (Inherited from Control.) | .gif) | OpenFile | Gets a Stream used to read a file. (Inherited from Control.) | .gif) | RaiseBubbleEvent | Assigns any sources of the event and its information to the control's parent. (Inherited from Control.) | .gif) | RemovedControl | Called after a child control is removed from the Controls collection of the Control object. (Inherited from Control.) | .gif) | Render | Renders the control to the specified HTML writer. (Inherited from WebControl.) | .gif) | RenderBeginTag | Renders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | RenderChildren | Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Inherited from Control.) | .gif) | RenderContents | Renders the contents of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | RenderControl(HtmlTextWriter) | Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (Inherited from Control.) | .gif) | RenderControl(HtmlTextWriter, ControlAdapter) | Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Inherited from Control.) | .gif) | RenderEndTag | Renders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers. (Inherited from WebControl.) | .gif) | ResolveAdapter | Gets the control adapter responsible for rendering the specified control. (Inherited from Control.) | .gif) | ResolveClientUrl | Gets a URL that can be used by the browser. (Inherited from Control.) | .gif) | ResolveUrl | Converts a URL into one that is usable on the requesting client. (Inherited from Control.) | .gif) | SaveControlState | Saves any server control state changes that have occurred since the time the page was posted back to the server. (Inherited from Control.) | .gif) | SaveViewState | Saves any state that was modified after the TrackViewState method was invoked. (Inherited from WebControl.) | .gif) | SetDesignModeState | Sets design-time data for a control. (Inherited from Control.) | .gif) | SetRenderMethodDelegate | Infrastructure. Assigns an event handler delegate to render the server control and its content into its parent control. (Inherited from Control.) | .gif) | ToString | Returns a string that represents the current object. (Inherited from Object.) | .gif) | TrackViewState | Causes the control to track changes to its view state so they can be stored in the object's ViewState property. (Inherited from WebControl.) | Top

Extension Methods

Explicit Interface Implementations
|
| Name | Description |
|---|
.gif) .gif) | IAttributeAccessor..::.GetAttribute | Infrastructure. Gets an attribute of the Web control with the specified name. (Inherited from WebControl.) | .gif) .gif) | IAttributeAccessor..::.SetAttribute | Sets an attribute of the Web control to the specified name and value. (Inherited from WebControl.) | .gif) .gif) | IControlBuilderAccessor..::.ControlBuilder | For a description of this member, see IControlBuilderAccessor..::.ControlBuilder. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.GetDesignModeState | For a description of this member, see IControlDesignerAccessor..::.GetDesignModeState. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetDesignModeState | For a description of this member, see IControlDesignerAccessor..::.SetDesignModeState. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetOwnerControl | Infrastructure. For a description of this member, see IControlDesignerAccessor..::.SetOwnerControl. (Inherited from Control.) | .gif) .gif) | IControlDesignerAccessor..::.UserData | For a description of this member, see IControlDesignerAccessor..::.UserData. (Inherited from Control.) | .gif) .gif) | IDataBindingsAccessor..::.DataBindings | For a description of this member, see IDataBindingsAccessor..::.DataBindings. (Inherited from Control.) | .gif) .gif) | IDataBindingsAccessor..::.HasDataBindings | For a description of this member, see IDataBindingsAccessor..::.HasDataBindings. (Inherited from Control.) | .gif) .gif) | IExpressionsAccessor..::.Expressions | For a description of this member, see IExpressionsAccessor..::.Expressions. (Inherited from Control.) | .gif) .gif) | IExpressionsAccessor..::.HasExpressions | For a description of this member, see IExpressionsAccessor..::.HasExpressions. (Inherited from Control.) | .gif) .gif) | IParserAccessor..::.AddParsedSubObject | For a description of this member, see IParserAccessor..::.AddParsedSubObject. (Inherited from Control.) | Top

Remarks
The TableHeaderRow class represents a heading row in a Table control. This class supports displaying tables on devices with a limited screen size. On these devices, a table with many columns and rows must be rendered across multiple pages. Adding a TableHeaderRow to a Table control allows you to specify a heading row that is rendered as the first row on each page that displays a view of the table. For more information about the view formats for a table rendered on a device with a limited screen size, see Table. A TableHeaderRow object can contain only TableCell objects. To add content to the TableHeaderRow, you must add one or more TableCell objects to the row. Then, set the Text property of each TableCell object in the row to specify the contents of each cell. Alternatively, you can add a control to a TableCell object to specify its contents. You can programmatically manage the cells in the TableHeaderRow by using the Cells collection. The Cells collection is a collection of TableCell objects that represent the cells in the row. The TableHeaderRow inherits properties from TableRow that allow you to control how the contents in the row are displayed. For example, you can use the HorizontalAlign and VerticalAlign properties to specify the alignment of the contents.

Examples
The following code example demonstrates the declarative syntax for creating a Table control that has a TableHeaderRow and a TableFooterRow.
<%@ page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow-TableFooterRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:Table id="Table1" runat="server"
CellPadding="3"
CellSpacing="0"
GridLines="both"
Caption="Sample Table">
<asp:TableHeaderRow id="Table1HeaderRow"
BackColor="LightBlue"
runat="server">
<asp:TableHeaderCell
Scope="Column"
Text="Col1" />
<asp:TableHeaderCell
Scope="Column"
Text="Col2" />
<asp:TableHeaderCell
Scope="Column"
Text="Col3" />
</asp:TableHeaderRow>
<asp:TableRow>
<asp:TableCell Text="(0,0)" />
<asp:TableCell Text="(0,1)" />
<asp:TableCell Text="(0,2)" />
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="(1,0)" />
<asp:TableCell Text="(1,1)" />
<asp:TableCell Text="(1,2)" />
</asp:TableRow>
<asp:TableFooterRow runat="server"
BackColor="LightBlue">
<asp:TableCell
ColumnSpan="3"
Text="The footer row." />
</asp:TableFooterRow>
</asp:Table>
</div>
</form>
</body>
</html>
The following code example demonstrates how to programmatically create a Table control that has a TableHeaderRow and a TableFooterRow. Note |
|---|
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Page Code Model. |
<%@ page language="VB" %>
<%@ Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Private Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
' Add rows to the table.
Dim rowNum As Integer
For rowNum = 0 To 100
Dim tempRow As New TableRow
Dim cellNum As Integer
For cellNum = 0 To 2
Dim tempCell As New TableCell
tempCell.Text = _
String.Format("({0},{1})", rowNum, cellNum)
tempRow.Cells.Add(tempCell)
Next
Table1.Rows.Add(tempRow)
Next
' Create a TableHeaderRow.
Dim headerRow As New TableHeaderRow
headerRow.BackColor = Color.LightBlue
' Create TableCell objects to contain
' the text for the header.
Dim headerTableCell1 As New TableHeaderCell
Dim headerTableCell2 As New TableHeaderCell
Dim headerTableCell3 As New TableHeaderCell
headerTableCell1.Text = "Column 1 Header"
headerTableCell1.Scope = TableHeaderScope.Column
headerTableCell1.AbbreviatedText = "Col 1 Head"
headerTableCell2.Text = "Column 2 Header"
headerTableCell2.Scope = TableHeaderScope.Column
headerTableCell2.AbbreviatedText = "Col 2 Head"
headerTableCell3.Text = "Column 3 Header"
headerTableCell3.Scope = TableHeaderScope.Column
headerTableCell3.AbbreviatedText = "Col 3 Head"
' Add the TableHeaderCell objects to the Cells
' collection of the TableHeaderRow.
headerRow.Cells.Add(headerTableCell1)
headerRow.Cells.Add(headerTableCell2)
headerRow.Cells.Add(headerTableCell3)
' Add the TableHeaderRow as the first item
' in the Rows collection of the table.
Table1.Rows.AddAt(0, headerRow)
' Create a TableFooterRow.
Dim footerRow As New TableFooterRow
footerRow.BackColor = Color.LightBlue
' Create TableCell objects to contain the
' text for the footer.
Dim footerTableCell1 As New TableCell
Dim footerTableCell2 As New TableCell
Dim footerTableCell3 As New TableCell
footerTableCell1.Text = "Column 1 footer"
footerTableCell2.Text = "Column 2 footer"
footerTableCell3.Text = "Column 3 footer"
' Add the TableCell objects to the Cells
' collection of the TableFooterRow.
footerRow.Cells.Add(footerTableCell1)
footerRow.Cells.Add(footerTableCell2)
footerRow.Cells.Add(footerTableCell3)
' Add the TableFooterRow to the Rows
' collection of the table.
Table1.Rows.Add(footerRow)
End Sub
</script>
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:table id="Table1"
CellPadding="3"
CellSpacing="0"
Gridlines="Both"
runat="server">
</asp:table>
</div>
</form>
</body>
</html>
<%@ page language="C#" %>
<%@ Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
// Add rows to the table.
for (int rowNum = 0; rowNum < 100; rowNum++)
{
TableRow tempRow = new TableRow();
for (int cellNum = 0; cellNum < 4; cellNum++)
{
TableCell tempCell = new TableCell();
tempCell.Text =
String.Format("({0},{1})", rowNum, cellNum);
tempRow.Cells.Add(tempCell);
}
Table1.Rows.Add(tempRow);
}
// Create a TableHeaderRow.
TableHeaderRow headerRow = new TableHeaderRow();
headerRow.BackColor = Color.LightBlue;
// Create TableCell objects to contain
// the text for the header.
TableHeaderCell headerTableCell1 = new TableHeaderCell();
TableHeaderCell headerTableCell2 = new TableHeaderCell();
TableHeaderCell headerTableCell3 = new TableHeaderCell();
headerTableCell1.Text = "Column 1 Header";
headerTableCell1.Scope = TableHeaderScope.Column;
headerTableCell1.AbbreviatedText = "Col 1 Head";
headerTableCell2.Text = "Column 2 Header";
headerTableCell2.Scope = TableHeaderScope.Column;
headerTableCell2.AbbreviatedText = "Col 2 Head";
headerTableCell3.Text = "Column 3 Header";
headerTableCell3.Scope = TableHeaderScope.Column;
headerTableCell3.AbbreviatedText = "Col 3 Head";
// Add the TableHeaderCell objects to the Cells
// collection of the TableHeaderRow.
headerRow.Cells.Add(headerTableCell1);
headerRow.Cells.Add(headerTableCell2);
headerRow.Cells.Add(headerTableCell3);
// Add the TableHeaderRow as the first item
// in the Rows collection of the table.
Table1.Rows.AddAt(0, headerRow);
// Create a TableFooterRow.
TableFooterRow footerRow = new TableFooterRow();
footerRow.BackColor = Color.LightBlue;
// Create TableCell objects to contain the
// text for the footer.
TableCell footerTableCell1 = new TableCell();
TableCell footerTableCell2 = new TableCell();
TableCell footerTableCell3 = new TableCell();
footerTableCell1.Text = "Column 1 footer";
footerTableCell2.Text = "Column 2 footer";
footerTableCell3.Text = "Column 3 footer";
// Add the TableCell objects to the Cells
// collection of the TableFooterRow.
footerRow.Cells.Add(footerTableCell1);
footerRow.Cells.Add(footerTableCell2);
footerRow.Cells.Add(footerTableCell3);
// Add the TableFooterRow to the Rows
// collection of the table.
Table1.Rows.Add(footerRow);
}
</script>
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:table id="Table1"
CellPadding="3"
CellSpacing="0"
Gridlines="Both"
runat="server">
</asp:table>
</div>
</form>
</body>
</html>

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also
|
Bibliothèque de classes .NET Framework TableHeaderRow, classe Représente une ligne d'en-tête dans un contrôle Table.

Hiérarchie d'héritage
Espace de noms :
System.Web.UI.WebControls
Assembly :
System.Web (dans System.Web.dll)

Syntaxe
Public Class TableHeaderRow _
Inherits TableRow
public class TableHeaderRow : TableRow
public ref class TableHeaderRow : public TableRow
type TableHeaderRow =
class
inherit TableRow
end
Le type TableHeaderRow expose les membres suivants.

Constructeurs
|
| Nom | Description |
|---|
.gif) | TableHeaderRow | Initialise une nouvelle instance de la classe TableHeaderRow. | Début

Méthodes
|
| Nom | Description |
|---|
.gif) | AddAttributesToRender | Ajoute des attributs et des styles HTML qui doivent être rendus au HtmlTextWriterTag spécifié. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | AddedControl | Appelée après l'ajout d'un contrôle enfant à la collection Controls de l'objet Control. (Hérité de Control.) | .gif) | AddParsedSubObject | Avertit le contrôle serveur qu'un élément XML ou HTML a été analysé et l'ajoute à l'objet ControlCollection du contrôle serveur. (Hérité de Control.) | .gif) | ApplyStyle | Copie tous les éléments non vides du style spécifié vers le contrôle Web, en remplaçant les éléments de style existants du contrôle. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | ApplyStyleSheetSkin | Applique les propriétés de style définies dans la feuille de style de la page au contrôle. (Hérité de Control.) | .gif) | BuildProfileTree | Infrastructure. Collecte des informations sur le contrôle serveur et les livre à la propriété Trace à afficher lorsque le traçage est activé pour la page. (Hérité de Control.) | .gif) | ClearCachedClientID | Infrastructure. Affecte à la valeur ClientID mise en cache la valeur nullNothingnullptrune référence null (Nothing en Visual Basic). (Hérité de Control.) | .gif) | ClearChildControlState | Supprime les informations sur l'état du contrôle des contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearChildState | Supprime les informations sur l'état d'affichage et sur l'état du contrôle de tous les contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearChildViewState | Supprime les informations d'état d'affichage de tous les contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | ClearEffectiveClientIDMode | Infrastructure. Affecte la valeur Inherit à la propriété ClientIDMode de l'instance de contrôle actuelle et de tous contrôles enfants. (Hérité de Control.) | .gif) | CopyBaseAttributes | Copie les propriétés non encapsulées par l'objet Style du contrôle serveur Web spécifié vers le contrôle serveur Web à partir duquel cette méthode est appelée. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | CreateChildControls | Appelé par l'infrastructure de page ASP.NET pour avertir les contrôles serveur qui utilisent une implémentation basée sur la composition qu'ils doivent créer tous les contrôles enfants qu'ils contiennent en préparation de la publication ou du rendu. (Hérité de Control.) | .gif) | CreateControlCollection | Crée un nouvel objet ControlCollection pour le contrôle TableRow. (Hérité de TableRow.) | .gif) | CreateControlStyle | Crée un objet TableItemStyle pour le contrôle TableRow. (Hérité de TableRow.) | .gif) | DataBind()()() | Lie une source de données au contrôle serveur appelé et à tous ses contrôles enfants. (Hérité de Control.) | .gif) | DataBind(Boolean) | Lie une source de données au contrôle serveur appelé et tous ses contrôles enfants avec une option pour déclencher l'événement DataBinding. (Hérité de Control.) | .gif) | DataBindChildren | Lie une source de données aux contrôles enfants du contrôle serveur. (Hérité de Control.) | .gif) | Dispose | Permet à un contrôle serveur d'effectuer le nettoyage final avant qu'il soit libéré de la mémoire. (Hérité de Control.) | .gif) | EnsureChildControls | Détermine si le contrôle serveur contient des contrôles enfants. S'il ne contient pas de contrôles enfants, il en crée. (Hérité de Control.) | .gif) | EnsureID | Crée un identificateur pour les contrôles auxquels aucun identificateur n'est assigné. (Hérité de Control.) | .gif) | Equals(Object) | Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.) | .gif) | Finalize | Autorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.) | .gif) | FindControl(String) | Recherche un contrôle serveur possédant le paramètre id spécifié dans le conteneur d'attribution de noms actuel. (Hérité de Control.) | .gif) | FindControl(String, Int32) | Infrastructure. Recherche le conteneur d'attribution de noms actuel d'un contrôle serveur avec l'id spécifié et un entier, spécifié dans le paramètre pathOffset, qui facilite la recherche. Vous ne devez pas substituer cette version de la méthode FindControl. (Hérité de Control.) | .gif) | Focus | Affecte le focus d'entrée à un contrôle. (Hérité de Control.) | .gif) | GetDesignModeState | Infrastructure. Obtient les données au moment du design pour un contrôle. (Hérité de Control.) | .gif) | GetHashCode | Sert de fonction de hachage pour un type particulier. (Hérité de Object.) | .gif) | GetRouteUrl(Object) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(RouteValueDictionary) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(String, Object) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire et à un nom d'itinéraire. (Hérité de Control.) | .gif) | GetRouteUrl(String, RouteValueDictionary) | Obtient l'URL qui correspond à un jeu de paramètres d'itinéraire et à un nom d'itinéraire. (Hérité de Control.) | .gif) | GetType | Obtient le Type de l'instance actuelle. (Hérité de Object.) | .gif) | GetUniqueIDRelativeTo | Retourne la partie préfixée de la propriété UniqueID du contrôle spécifié. (Hérité de Control.) | .gif) | HasControls | Détermine si le contrôle serveur contient des contrôles enfants. (Hérité de Control.) | .gif) | HasEvents | Retourne une valeur indiquant si des événements sont inscrits pour le contrôle ou des contrôles enfants. (Hérité de Control.) | .gif) | IsLiteralContent | Infrastructure. Détermine si le contrôle serveur ne détient qu'un contenu littéral. (Hérité de Control.) | .gif) | LoadControlState | Restaure des informations sur l'état du contrôle à partir d'une demande de page antérieure enregistrée par la méthode SaveControlState. (Hérité de Control.) | .gif) | LoadViewState | Restaure les informations d'état d'affichage à partir d'une précédente requête enregistrées avec la méthode SaveViewState. (Hérité de WebControl.) | .gif) | MapPathSecure | Récupère le chemin d'accès physique auquel un chemin d'accès virtuel, absolu ou relatif, correspond. (Hérité de Control.) | .gif) | MemberwiseClone | Crée une copie superficielle de l'objet Object actif. (Hérité de Object.) | .gif) | MergeStyle | Copie tous les éléments non vides du style spécifié vers le contrôle Web, mais ne remplace aucun élément de style existant du contrôle. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | OnBubbleEvent | Détermine si l'événement pour le contrôle serveur est passé dans la hiérarchie des contrôles serveur de l'interface utilisateur de la page. (Hérité de Control.) | .gif) | OnDataBinding | Déclenche l'événement DataBinding. (Hérité de Control.) | .gif) | OnInit | Déclenche l'événement Init. (Hérité de Control.) | .gif) | OnLoad | Déclenche l'événement Load. (Hérité de Control.) | .gif) | OnPreRender | Déclenche l'événement PreRender. (Hérité de Control.) | .gif) | OnUnload | Déclenche l'événement Unload. (Hérité de Control.) | .gif) | OpenFile | Obtient un Stream utilisé pour lire un fichier. (Hérité de Control.) | .gif) | RaiseBubbleEvent | Assigne les sources éventuelles de l'événement et ses informations au parent du contrôle. (Hérité de Control.) | .gif) | RemovedControl | Appelée après la suppression d'un contrôle enfant dans la collection Controls de l'objet Control. (Hérité de Control.) | .gif) | Render | Génère le rendu du contrôle via le writer HTML spécifié. (Hérité de WebControl.) | .gif) | RenderBeginTag | Génère le rendu de la balise d'ouverture HTML du contrôle via le writer spécifié. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | RenderChildren | Renvoie le contenu des enfants d'un contrôle serveur dans un objet HtmlTextWriter fourni, qui écrit le contenu à rendre sur le client. (Hérité de Control.) | .gif) | RenderContents | Génère le rendu du contenu du contrôle via le writer spécifié. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | RenderControl(HtmlTextWriter) | Renvoie le contenu du contrôle serveur dans un objet HtmlTextWriter fourni et stocke des informations de traçage au sujet du contrôle si le traçage est activé. (Hérité de Control.) | .gif) | RenderControl(HtmlTextWriter, ControlAdapter) | Génère le contenu du contrôle serveur dans un objet HtmlTextWriter à l'aide d'un objet ControlAdapter fourni. (Hérité de Control.) | .gif) | RenderEndTag | Génère le rendu de la balise de fermeture HTML du contrôle via le writer spécifié. Cette méthode est principalement utilisée par des développeurs de contrôles. (Hérité de WebControl.) | .gif) | ResolveAdapter | Obtient l'adaptateur de contrôles responsable du rendu du contrôle spécifié. (Hérité de Control.) | .gif) | ResolveClientUrl | Obtient une URL qui peut être utilisée par le navigateur. (Hérité de Control.) | .gif) | ResolveUrl | Convertit une URL en une URL que le client soit en mesure d'utiliser. (Hérité de Control.) | .gif) | SaveControlState | Enregistre les modifications éventuellement apportées à l'état du contrôle serveur depuis la publication de la page sur le serveur. (Hérité de Control.) | .gif) | SaveViewState | Enregistre les états modifiés après l'appel de la méthode TrackViewState. (Hérité de WebControl.) | .gif) | SetDesignModeState | Définit les données au moment du design pour un contrôle. (Hérité de Control.) | .gif) | SetRenderMethodDelegate | Infrastructure. Assigne un délégué de gestionnaires d'événements pour générer le rendu du contrôle serveur et de son contenu dans son contrôle parent. (Hérité de Control.) | .gif) | ToString | Retourne une chaîne qui représente l'objet actuel. (Hérité de Object.) | .gif) | TrackViewState | Amène le contrôle à suivre les modifications apportées à son état d'affichage afin qu'elles puissent être stockées dans la propriété ViewState de l'objet. (Hérité de WebControl.) | Début

Méthodes d'extension

Implémentations d'interface explicite
|
| Nom | Description |
|---|
.gif) .gif) | IAttributeAccessor..::.GetAttribute | Infrastructure. Obtient un attribut du contrôle Web avec le nom spécifié. (Hérité de WebControl.) | .gif) .gif) | IAttributeAccessor..::.SetAttribute | Affecte au nom et à la valeur spécifiés un attribut du contrôle Web. (Hérité de WebControl.) | .gif) .gif) | IControlBuilderAccessor..::.ControlBuilder | Pour obtenir une description de ce membre, consultez IControlBuilderAccessor..::.ControlBuilder. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.GetDesignModeState | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.GetDesignModeState. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetDesignModeState | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.SetDesignModeState. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.SetOwnerControl | Infrastructure. Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.SetOwnerControl. (Hérité de Control.) | .gif) .gif) | IControlDesignerAccessor..::.UserData | Pour obtenir une description de ce membre, consultez IControlDesignerAccessor..::.UserData. (Hérité de Control.) | .gif) .gif) | IDataBindingsAccessor..::.DataBindings | Pour obtenir une description de ce membre, consultez IDataBindingsAccessor..::.DataBindings. (Hérité de Control.) | .gif) .gif) | IDataBindingsAccessor..::.HasDataBindings | Pour obtenir une description de ce membre, consultez IDataBindingsAccessor..::.HasDataBindings. (Hérité de Control.) | .gif) .gif) | IExpressionsAccessor..::.Expressions | Pour obtenir une description de ce membre, consultez IExpressionsAccessor..::.Expressions. (Hérité de Control.) | .gif) .gif) | IExpressionsAccessor..::.HasExpressions | Pour obtenir une description de ce membre, consultez IExpressionsAccessor..::.HasExpressions. (Hérité de Control.) | .gif) .gif) | IParserAccessor..::.AddParsedSubObject | Pour obtenir une description de ce membre, consultez IParserAccessor..::.AddParsedSubObject. (Hérité de Control.) | Début

Notes
La classe TableHeaderRow représente une ligne d'en-tête dans un contrôle Table. Cette classe prend en charge l'affichage de tableaux sur les appareils avec une taille d'écran limitée. Sur ces appareils, un tableau avec de nombreuses colonnes et lignes doit être rendu sur plusieurs pages. L'ajout d'un TableHeaderRow à un contrôle Table vous permet de spécifier une ligne d'en-tête qui est rendue comme première ligne sur chaque page qui affiche une vue du tableau. Pour plus d'informations sur les formats d'affichage d'un tableau rendu sur un appareil avec une taille d'écran limitée, consultez Table. Un objet TableHeaderRow peut contenir uniquement des objets TableCell. Pour ajouter le contenu au TableHeaderRow, vous devez ajouter un ou plusieurs objets TableCell à la ligne. Ensuite, définissez la propriété Text de chaque objet TableCell dans la ligne pour spécifier le contenu de chaque cellule. Vous pouvez également ajouter un contrôle à un objet TableCell pour spécifier son contenu. Vous pouvez gérer les cellules du TableHeaderRow par programme à l'aide de la collection Cells. La collection Cells est une collection d'objets TableCell qui représentent les cellules dans la ligne. Le TableHeaderRow hérite des propriétés de TableRow qui vous permettent de contrôler comment le contenu de la ligne s'affiche. Par exemple, vous pouvez utiliser les propriétés HorizontalAlign et VerticalAlign pour spécifier l'alignement du contenu.

Exemples
L'exemple de code suivant décrit la syntaxe déclarative pour créer un contrôle Table qui a un TableHeaderRow et un TableFooterRow.
<%@ page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow-TableFooterRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:Table id="Table1" runat="server"
CellPadding="3"
CellSpacing="0"
GridLines="both"
Caption="Sample Table">
<asp:TableHeaderRow id="Table1HeaderRow"
BackColor="LightBlue"
runat="server">
<asp:TableHeaderCell
Scope="Column"
Text="Col1" />
<asp:TableHeaderCell
Scope="Column"
Text="Col2" />
<asp:TableHeaderCell
Scope="Column"
Text="Col3" />
</asp:TableHeaderRow>
<asp:TableRow>
<asp:TableCell Text="(0,0)" />
<asp:TableCell Text="(0,1)" />
<asp:TableCell Text="(0,2)" />
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text="(1,0)" />
<asp:TableCell Text="(1,1)" />
<asp:TableCell Text="(1,2)" />
</asp:TableRow>
<asp:TableFooterRow runat="server"
BackColor="LightBlue">
<asp:TableCell
ColumnSpan="3"
Text="The footer row." />
</asp:TableFooterRow>
</asp:Table>
</div>
</form>
</body>
</html>
L'exemple de code suivant montre comment créer par programme un contrôle Table qui a un TableHeaderRow et un TableFooterRow. Remarque |
|---|
L'exemple de code suivant utilise un modèle de code de fichier unique ; il est possible qu'il ne fonctionne pas correctement s'il est directement copié dans un fichier code-behind. Cet exemple de code doit être copié dans un fichier texte vide doté d'une extension .aspx. Pour plus d'informations sur le modèle de code des Web Forms, consultez Modèle de code des pages Web ASP.NET. |
<%@ page language="VB" %>
<%@ Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Private Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
' Add rows to the table.
Dim rowNum As Integer
For rowNum = 0 To 100
Dim tempRow As New TableRow
Dim cellNum As Integer
For cellNum = 0 To 2
Dim tempCell As New TableCell
tempCell.Text = _
String.Format("({0},{1})", rowNum, cellNum)
tempRow.Cells.Add(tempCell)
Next
Table1.Rows.Add(tempRow)
Next
' Create a TableHeaderRow.
Dim headerRow As New TableHeaderRow
headerRow.BackColor = Color.LightBlue
' Create TableCell objects to contain
' the text for the header.
Dim headerTableCell1 As New TableHeaderCell
Dim headerTableCell2 As New TableHeaderCell
Dim headerTableCell3 As New TableHeaderCell
headerTableCell1.Text = "Column 1 Header"
headerTableCell1.Scope = TableHeaderScope.Column
headerTableCell1.AbbreviatedText = "Col 1 Head"
headerTableCell2.Text = "Column 2 Header"
headerTableCell2.Scope = TableHeaderScope.Column
headerTableCell2.AbbreviatedText = "Col 2 Head"
headerTableCell3.Text = "Column 3 Header"
headerTableCell3.Scope = TableHeaderScope.Column
headerTableCell3.AbbreviatedText = "Col 3 Head"
' Add the TableHeaderCell objects to the Cells
' collection of the TableHeaderRow.
headerRow.Cells.Add(headerTableCell1)
headerRow.Cells.Add(headerTableCell2)
headerRow.Cells.Add(headerTableCell3)
' Add the TableHeaderRow as the first item
' in the Rows collection of the table.
Table1.Rows.AddAt(0, headerRow)
' Create a TableFooterRow.
Dim footerRow As New TableFooterRow
footerRow.BackColor = Color.LightBlue
' Create TableCell objects to contain the
' text for the footer.
Dim footerTableCell1 As New TableCell
Dim footerTableCell2 As New TableCell
Dim footerTableCell3 As New TableCell
footerTableCell1.Text = "Column 1 footer"
footerTableCell2.Text = "Column 2 footer"
footerTableCell3.Text = "Column 3 footer"
' Add the TableCell objects to the Cells
' collection of the TableFooterRow.
footerRow.Cells.Add(footerTableCell1)
footerRow.Cells.Add(footerTableCell2)
footerRow.Cells.Add(footerTableCell3)
' Add the TableFooterRow to the Rows
' collection of the table.
Table1.Rows.Add(footerRow)
End Sub
</script>
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:table id="Table1"
CellPadding="3"
CellSpacing="0"
Gridlines="Both"
runat="server">
</asp:table>
</div>
</form>
</body>
</html>
<%@ page language="C#" %>
<%@ Import Namespace="System.Drawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
// Add rows to the table.
for (int rowNum = 0; rowNum < 100; rowNum++)
{
TableRow tempRow = new TableRow();
for (int cellNum = 0; cellNum < 4; cellNum++)
{
TableCell tempCell = new TableCell();
tempCell.Text =
String.Format("({0},{1})", rowNum, cellNum);
tempRow.Cells.Add(tempCell);
}
Table1.Rows.Add(tempRow);
}
// Create a TableHeaderRow.
TableHeaderRow headerRow = new TableHeaderRow();
headerRow.BackColor = Color.LightBlue;
// Create TableCell objects to contain
// the text for the header.
TableHeaderCell headerTableCell1 = new TableHeaderCell();
TableHeaderCell headerTableCell2 = new TableHeaderCell();
TableHeaderCell headerTableCell3 = new TableHeaderCell();
headerTableCell1.Text = "Column 1 Header";
headerTableCell1.Scope = TableHeaderScope.Column;
headerTableCell1.AbbreviatedText = "Col 1 Head";
headerTableCell2.Text = "Column 2 Header";
headerTableCell2.Scope = TableHeaderScope.Column;
headerTableCell2.AbbreviatedText = "Col 2 Head";
headerTableCell3.Text = "Column 3 Header";
headerTableCell3.Scope = TableHeaderScope.Column;
headerTableCell3.AbbreviatedText = "Col 3 Head";
// Add the TableHeaderCell objects to the Cells
// collection of the TableHeaderRow.
headerRow.Cells.Add(headerTableCell1);
headerRow.Cells.Add(headerTableCell2);
headerRow.Cells.Add(headerTableCell3);
// Add the TableHeaderRow as the first item
// in the Rows collection of the table.
Table1.Rows.AddAt(0, headerRow);
// Create a TableFooterRow.
TableFooterRow footerRow = new TableFooterRow();
footerRow.BackColor = Color.LightBlue;
// Create TableCell objects to contain the
// text for the footer.
TableCell footerTableCell1 = new TableCell();
TableCell footerTableCell2 = new TableCell();
TableCell footerTableCell3 = new TableCell();
footerTableCell1.Text = "Column 1 footer";
footerTableCell2.Text = "Column 2 footer";
footerTableCell3.Text = "Column 3 footer";
// Add the TableCell objects to the Cells
// collection of the TableFooterRow.
footerRow.Cells.Add(footerTableCell1);
footerRow.Cells.Add(footerTableCell2);
footerRow.Cells.Add(footerTableCell3);
// Add the TableFooterRow to the Rows
// collection of the table.
Table1.Rows.Add(footerRow);
}
</script>
<html >
<head id="Head1" runat="server">
<title>TableHeaderRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>TableHeaderRow and TableFooterRow Example</h3>
<asp:table id="Table1"
CellPadding="3"
CellSpacing="0"
Gridlines="Both"
runat="server">
</asp:table>
</div>
</form>
</body>
</html>

Informations de version
.NET FrameworkPris en charge dans : 4, 3.5, 3.0, 2.0

Plateformes
Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Sécurité des threads
Tous les membres static ( Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Voir aussi
RéférenceAutres ressources
|