DataGrid3
DataGrid3通过添加可视
格式化和内容格式化构建于DataGrid2之上。
摘自 DataGrid3.aspx:
〈%@ Page language="C#" src="DataGrid.cs" inherits="Samples.Data
GridPage"%〉
...
〈asp:DataGrid runat=server id="titlesGrid"
AutoGenerateColumns="false"
BackColor="White"
Border BorderStyle="Solid" CellPadding="2" Cell
Spacing="0"
BorderColor="Tan"
Font-Name="宋体" Font-Size="8pt"〉
〈property name="Columns"〉
〈asp:BoundColumn headerText="Title" DataField="title"/〉
〈asp:BoundColumn headerText="Author" DataField="au_name"/〉
〈asp:BoundColumn headerText="Date Published" DataField=
"pubdate"
DataFormatString="{0:MMM yyyy}"/〉
〈asp:BoundColumn headerText="Price" DataField="price"
DataFormatString="{0:c}"〉
〈property name="ItemStyle"〉
〈asp:TableItemStyle HorizontalAlign="Right"/〉
〈/property〉
〈/asp:BoundColumn〉
〈/property〉
〈property name="headerStyle"〉
〈asp:TableItemStyle BackColor="DarkRed" ForeColor="White"