TableCell.CreateControlStyle Method

Creates a TableItemStyle for the TableCell control.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

protected:
virtual Style^ CreateControlStyle () override
protected Style CreateControlStyle ()
protected override function CreateControlStyle () : Style
Not applicable.

Return Value

A Style that represents the TableItemStyle for the TableCell control.

The TableItemStyle created by the CreateControlStyle method is used with the Wrap, HorizontalAlign, and VerticalAlign properties.

The CreateControlStyle method is used primarily by control developers extending the functionality of the TableCell control.

The following code example demonstrates how to override the CreateControlStyle method in a custom server control so that it always returns a new instance of the TableStyle class for the TableCell.

No code example is currently available or this language may not be supported.
<%@ Page Language="VJ#" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.JSL.Controls" 
    Assembly="Samples.AspNet.JSL" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head2" runat="server">
    <title>Custom TableCell - CreateControlStyle - VJ# Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <h3>Custom TableCell - CreateControlStyle - VJ# Example</h3>
        
    <asp:Table id="Table1" runat="server" CellPadding="3" CellSpacing="2">
      <asp:TableRow>
        <aspSample:CustomTableCellCreateControlStyle Text="(0,0)" />
        <aspSample:CustomTableCellCreateControlStyle Text="(0,1)" />
        <aspSample:CustomTableCellCreateControlStyle Text="(0,2)" />
      </asp:TableRow>
      <asp:TableRow>
        <aspSample:CustomTableCellCreateControlStyle Text="(1,0)" />
        <aspSample:CustomTableCellCreateControlStyle Text="(1,1)" />
        <aspSample:CustomTableCellCreateControlStyle Text="(1,2)" />
      </asp:TableRow>
    </asp:Table>
 
    </div>
    </form>
</body>
</html>

No code example is currently available or this language may not be supported.
package Samples.AspNet.JSL.Controls; 

public class CustomTableCellCreateControlStyle
    extends System.Web.UI.WebControls.TableCell
{
    protected System.Web.UI.WebControls.Style CreateControlStyle()
    {
        // Initializes and return a new instance of the TableStyle class.
        return new System.Web.UI.WebControls.TableStyle(this.get_ViewState());
    } //CreateControlStyle
} //CustomTableCellCreateControlStyle

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: