summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TDataList/Sample1.page
blob: 467dc2393d7533f9296f20b2499f937a471dd3c3 (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
<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="lightgreen"
     HeaderStyle.BackColor="#AAAADD"
     FooterStyle.BackColor="#DDAAAA"
     AlternatingItemStyle.BackColor="lightyellow">

<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->Parent->ItemCount %> products.
</div>
</prop:FooterTemplate>

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

</com:TDataList>

</com:TContent>