summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TPager/Sample1.page
blob: e70f8e7744e6cf4037737d72e81b0bda2dc25338 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<com:TContent ID="body">

<h1>TPager Sample</h1>
<p>
The following sample displays four different pagers associated with a single TDataList control. The datalist control is enabled with custom paging, which allows it to read only one page of data each time. This is typical in DB-driven applications.
</p>

<div>
Go to page:
<com:TPager ID="Pager"
	ControlToPaginate="DataList"
	PageButtonCount="3"
	Mode="Numeric"
	OnPageIndexChanged="pageChanged"
	/>
</div>

<com:TDataList
     ID="DataList"
     AllowPaging="true"
     AllowCustomPaging="true"
	 PageSize="2"
     EnableViewState="true"
     RepeatColumns="2"
     RepeatDirection="Vertical"
     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->PageCount %> pages.
</div>
</prop:FooterTemplate>

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

</com:TDataList>

<com:TPager ID="Pager2"
	ControlToPaginate="DataList"
	FirstPageText="9"
	LastPageText=":"
	Mode="NextPrev"
	NextPageText="4"
	PrevPageText="3"
	Font.Name="Webdings"
	OnPageIndexChanged="pageChanged"
	/>
<br/>
Choose page:
<com:TPager ID="Pager3"
	ControlToPaginate="DataList"
	Mode="DropDownList"
	OnPageIndexChanged="pageChanged"
	/>
<br/>
Use of a css class for buttons:
<com:TStyleSheet>
.greenbold_button {
	background-color: #0f0;
	font-weight: bold;
}
</com:TStyleSheet>
<com:TPager ID="Pager4"
	ControlToPaginate="DataList"
	PageButtonCount="3"
	Mode="Numeric"
	ButtonType="PushButton"
	OnPageIndexChanged="pageChanged"
	ButtonCssClass="greenbold_button"
	/>
</com:TContent>