| 1 |
lars |
1 |
<com:TContent ID="body">
|
|
|
2 |
|
|
|
3 |
<h1>TDataGrid Sample 4</h1>
|
|
|
4 |
<h2>Sorting with TDataGrid</h2>
|
|
|
5 |
|
|
|
6 |
<com:TDataGrid
|
|
|
7 |
Width="700px"
|
|
|
8 |
CellPadding="2"
|
|
|
9 |
ID="DataGrid"
|
|
|
10 |
AutoGenerateColumns="false"
|
|
|
11 |
HeaderStyle.BackColor="black"
|
|
|
12 |
HeaderStyle.ForeColor="white"
|
|
|
13 |
ItemStyle.BackColor="#BFCFFF"
|
|
|
14 |
ItemStyle.Font.Italic="true"
|
|
|
15 |
AlternatingItemStyle.BackColor="#E6ECFF"
|
|
|
16 |
AllowSorting="true"
|
|
|
17 |
OnSortCommand="sortDataGrid">
|
|
|
18 |
|
|
|
19 |
<com:THyperLinkColumn
|
|
|
20 |
SortExpression="title"
|
|
|
21 |
HeaderText="Book Title"
|
|
|
22 |
DataTextField="title"
|
|
|
23 |
DataNavigateUrlField="ISBN"
|
|
|
24 |
DataNavigateUrlFormatString="http://www.amazon.com/gp/product/%s"
|
|
|
25 |
Target="_blank"
|
|
|
26 |
/>
|
|
|
27 |
<com:TBoundColumn
|
|
|
28 |
SortExpression="publisher"
|
|
|
29 |
HeaderText="Publisher"
|
|
|
30 |
DataField="publisher"
|
|
|
31 |
/>
|
|
|
32 |
<com:TBoundColumn
|
|
|
33 |
SortExpression="price"
|
|
|
34 |
ItemStyle.HorizontalAlign="Right"
|
|
|
35 |
ItemStyle.Wrap="false"
|
|
|
36 |
ItemStyle.Font.Italic="false"
|
|
|
37 |
ItemStyle.ForeColor="green"
|
|
|
38 |
HeaderText="Price"
|
|
|
39 |
DataField="price"
|
|
|
40 |
DataFormatString="$%.2f"
|
|
|
41 |
/>
|
|
|
42 |
<com:TCheckBoxColumn
|
|
|
43 |
SortExpression="instock"
|
|
|
44 |
HeaderText="In-stock"
|
|
|
45 |
HeaderStyle.Wrap="false"
|
|
|
46 |
DataField="instock"
|
|
|
47 |
/>
|
|
|
48 |
<com:TTemplateColumn HeaderText="Rating" SortExpression="rating">
|
|
|
49 |
<prop:ItemTemplate>
|
|
|
50 |
<img src="images/star<%#$this->NamingContainer->DataItem['rating']%>.gif" alt="" />
|
|
|
51 |
</prop:ItemTemplate>
|
|
|
52 |
</com:TTemplateColumn>
|
|
|
53 |
</com:TDataGrid>
|
|
|
54 |
|
|
|
55 |
<div class="last-modified">$Id: Sample4.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
|