TableHeaderCell.CategoryText 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 TableHeaderCell 控件的 HTML axis
元素的 th
特性。
public:
virtual property cli::array <System::String ^> ^ CategoryText { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))]
public virtual string[] CategoryText { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))>]
member this.CategoryText : string[] with get, set
Public Overridable Property CategoryText As String()
属性值
String[]
一个表示 TableHeaderCell 类别的字符串值的数组。
- 属性
示例
下面的代码示例演示如何以声明方式对 CategoryText 属性进行编程。
<%@ page language="C#" %>
<!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="Head1" runat="server">
<title>TableHeaderCell Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>TableHeaderCell Example</h1>
<asp:table id="Table1" runat="server"
CellPadding="3"
CellSpacing="3"
BorderWidth="1"
GridLines="Both">
<asp:TableHeaderRow ID="TableHeaderRow1" runat="server">
<asp:TableHeaderCell runat="server"
ID="Column1Header"
CategoryText="Column1"
AbbreviatedText="Header 1"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 1 Header
</asp:TableHeaderCell>
<asp:TableHeaderCell runat="server"
ID="Column2Header"
CategoryText="Column2,Column2Alternative"
AbbreviatedText="Header 2"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 2 Header
</asp:TableHeaderCell>
<asp:TableHeaderCell runat="server"
ID="Column3Header"
CategoryText="Column3"
AbbreviatedText="Header 3"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 3 Header
</asp:TableHeaderCell>
</asp:TableHeaderRow>
<asp:TableRow HorizontalAlign="Center">
<asp:TableCell AssociatedHeaderCellID="Column1Header"
HorizontalAlign="Left">
(0,0)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column2Header">
(0,1)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column3Header">
(0,2)
</asp:TableCell>
</asp:TableRow>
<asp:TableRow
HorizontalAlign="Center">
<asp:TableCell
AssociatedHeaderCellID="Column1Header"
HorizontalAlign="Left">
(1,0)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column2Header">
(1,1)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column3Header">
(1,2)
</asp:TableCell>
</asp:TableRow>
<asp:TableRow
HorizontalAlign="Center">
<asp:TableCell
AssociatedHeaderCellID=
"Column1Header,Column2Header,Column3Header"
ColumnSpan="3"
HorizontalAlign="Left">
(2,0)
</asp:TableCell>
</asp:TableRow>
</asp:table>
</div>
</form>
</body>
</html>
<%@ page language="VB" %>
<!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="Head1" runat="server">
<title>TableHeaderCell Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>TableHeaderCell Example</h1>
<asp:table id="Table1" runat="server"
CellPadding="3"
CellSpacing="3"
BorderWidth="1"
GridLines="Both">
<asp:TableHeaderRow ID="TableHeaderRow1" runat="server">
<asp:TableHeaderCell runat="server"
ID="Column1Header"
CategoryText="Column1"
AbbreviatedText="Header 1"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 1 Header
</asp:TableHeaderCell>
<asp:TableHeaderCell runat="server"
ID="Column2Header"
CategoryText="Column2,Column2Alternative"
AbbreviatedText="Header 2"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 2 Header
</asp:TableHeaderCell>
<asp:TableHeaderCell runat="server"
ID="Column3Header"
CategoryText="Column3"
AbbreviatedText="Header 3"
Scope="Column"
HorizontalAlign="Center"
VerticalAlign="Middle"
BackColor="LightGray">
Column 3 Header
</asp:TableHeaderCell>
</asp:TableHeaderRow>
<asp:TableRow HorizontalAlign="Center">
<asp:TableCell AssociatedHeaderCellID="Column1Header"
HorizontalAlign="Left">
(0,0)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column2Header">
(0,1)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column3Header">
(0,2)
</asp:TableCell>
</asp:TableRow>
<asp:TableRow
HorizontalAlign="Center">
<asp:TableCell
AssociatedHeaderCellID="Column1Header"
HorizontalAlign="Left">
(1,0)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column2Header">
(1,1)
</asp:TableCell>
<asp:TableCell
AssociatedHeaderCellID="Column3Header">
(1,2)
</asp:TableCell>
</asp:TableRow>
<asp:TableRow
HorizontalAlign="Center">
<asp:TableCell
AssociatedHeaderCellID=
"Column1Header,Column2Header,Column3Header"
ColumnSpan="3"
HorizontalAlign="Left">
(2,0)
</asp:TableCell>
</asp:TableRow>
</asp:table>
</div>
</form>
</body>
</html>
注解
类别可以是与表相关的任何字符串值。 属性 CategoryText 呈现为 axis
HTML th
元素的 属性,该属性用于将表单元格分组为概念类别。 类别以 HTML 形式呈现为逗号分隔列表。
此属性的值存储在视图状态中。