使用 ASP+ 列表绑定控件(下)

作者:袖梨 2022-06-30
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"

相关文章

精彩推荐