summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample1.page
blob: 47d661887a95fcf84436bb7cab1885bcd8abc471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<com:TContent ID="body">

<h1>TDataList Sample 1</h1>
<p>
TDataList is good at displaying tabular data in a non-tabular format. The following example displays a list of computer product information in 3 columns.
</p>
<p>
Since the page is mainly for display and does not require user interactions, the viewstate of TDataList is disabled to reduce page size.
</p>

<com:TDataList
     ID="DataList"
     EnableViewState="false"
     RepeatColumns="3"
     RepeatDirection="Horizontal"
     ItemStyle.Font.Italic="true"
     ItemStyle.BackColor="#BFCFFF"
     HeaderStyle.BackColor="black"
     HeaderStyle.ForeColor="white"
     FooterStyle.BackColor="gray"
     AlternatingItemStyle.BackColor="#E6ECFF">

<prop:HeaderTemplate>
<div style="font-weight:bold; text-align:center;">Computer Parts</div>
</prop:HeaderTemplate>

<prop:FooterTemplate>
<div style="font-weight:bold; text-align:center;">
Total <%# $this->Parent->ItemCount %> products.
</div>
</prop:FooterTemplate>

<prop:ItemTemplate>
<table border="0" width="100%">
<tr>
  <th>ID</th><th>Name</th><th>Quantity</th><th>Price</th>
</tr>
<tr>
  <td align="right"><%#$this->DataItem['id'] %></td>
  <td align="right"><%#$this->DataItem['name'] %></td>
  <td align="right"><%#$this->DataItem['quantity'] %></td>
  <td align="right">$<%#$this->DataItem['price'] %></td>
</tr>
</table>
</prop:ItemTemplate>

</com:TDataList>

</com:TContent>