summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/List.page
blob: dd5c9002a238899aa168ac2f52cf99b8986efdbf (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
<com:TContent ID="body" >

<h1>List Controls</h1>
<p>
List controls covered in this section all inherit directly or indirectly from <tt>TListControl</tt>. Therefore, they share the same set of commonly used properties, including,
<ul>
<li><tt>Items</tt> - list of items in the control. The items are of type <tt>TListItem</tt>. The item list can be populated via databinding or specified in templates like the following:
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;com:TListBox&gt;
  &lt;com:TListItem Text="text 1" Value="value 1" /&gt;
  &lt;com:TListItem Text="text 2" Value="value 2" Selected="true" /&gt;
  &lt;com:TListItem Text="text 3" Value="value 3" /&gt;
&lt;/com:TListBox&gt;
</com:TTextHighlighter>
</li>
<li><tt>SelectedIndex</tt> - the zero-based index of the first selected item in the item list.</li>
<li><tt>SelectedIndices</tt> - the indices of all selected items.</li>
<li><tt>SelectedItem</tt> - the first selected item in the item list.</li>
<li><tt>SelectedValue</tt> - the value of the first selected item in the item list.</li>
<li><tt>AutoPostBack</tt> - whether changing the selection of the control should trigger postback.</li>
<li><tt>CausesValidation</tt> - whether validation should be performed when postback is triggered by the list control.</li>
</ul>
</p>
<p>
Since <tt>TListControl</tt> inherits from <tt>TDataBoundControl</tt>, these list controls also share a common operation known as <tt>databinding</tt>. The data to be bound can be specified via either <tt>DataSource</tt> or <tt>DataSourceID</tt>. More details about databinding are covered in later chapters of this tutorial.
</p>

<h2>TListBox</h2>
<p>
<tt>TListBox</tt> displays a list box that allows single or multiple selection. Set the property <tt>SelectionMode</tt> as <tt>Single</tt> to make a single selection list box, and <tt>Multiple</tt> a multiple selection list box. The number of rows displayed in the box is specified via the <tt>Rows</tt> property value.
</p>
<com:RunBar PagePath="Controls.Samples.TListBox.Home" />

<h2>TDropDownList</h2>
<p>
<tt>TDropDownList</tt> displays a dropdown list box that allows users to select a single option from a few prespecified ones.
</p>
<com:RunBar PagePath="Controls.Samples.TDropDownList.Home" />

<h2>TCheckBoxList</h2>
<p>
<tt>TCheckBoxList</tt> displays a list of checkboxes on a Web page. The alignment of the text besides each checkbox can be specified <tt>TextAlign</tt>. The layout of the checkboxes can be controlled by the following properties:
<ul>
  <li><tt>RepeatLayout</tt> - can be either <tt>Table</tt> or <tt>Flow</tt>. A <tt>Table</tt> uses HTML table cells to organize the checkboxes, while a <tt>Flow</tt> uses HTML span tags and breaks for the organization. With <tt>Table</tt> layout, you can set <tt>CellPadding</tt> and <tt>CellSpacing</tt>.</li>
  <li><tt>RepeatColumns</tt> - how many columns the checkboxes should be displayed in.</li>
  <li><tt>RepeatDirection</tt> - how to traverse the checkboxes, in a horizontal way or a vertical way (because the checkboxes are displayed in a matrix-like layout).</li>
</ul>
</p>
<com:RunBar PagePath="Controls.Samples.TCheckBoxList.Home" />

<h2>TRadioButtonList</h2>
<p>
<tt>TRadioButtonList</tt> is similar to <tt>TCheckBoxList</tt> in every aspect except that each <tt>TRadioButtonList</tt> displays a group of radiobuttons. Only one of the radiobuttions can be selected (<tt>TCheckBoxList</tt> allows multiple selections.)
</p>
<com:RunBar PagePath="Controls.Samples.TRadioButtonList.Home" />

<h2>TBulletList</h2>
<p>
<tt>TBulletedList</tt> displays items in a bullet format on a Web page. The style of the bullets can be specified by <tt>BulletStyle</tt>. When the style is <tt>CustomImage</tt>, the bullets are displayed as images, which is specified by <tt>BulletImageUrl</tt>.
</p>
<p>
<tt>TBulletedList</tt> displays the item texts in three different modes,
<ul>
  <li><tt>Text</tt> - the item texts are displayed as static texts;</li>
  <li><tt>HyperLink</tt> - each item is displayed as a hyperlink whose URL is given by the item value, and <tt>Target</tt> property can be used to specify the target browser window;</li>
  <li><tt>LinkButton</tt> - each item is displayed as a link button which posts back to the page if a user clicks on that, and the event <tt>OnClick</tt> will be raised under such a circumstance.</li>
</ul>
</p>
<com:RunBar PagePath="Controls.Samples.TBulletedList.Home" />

</com:TContent>