summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveListBox/Home.page
blob: 218139a50de7b2a09769ac57e5b45e77c322c325 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<com:TContent ID="body">

<h1>TActiveListBox Samples</h1>

<table class="sampletable">

<tr>
<td class="samplenote">
Callback listbox:
</td>
<td class="sampleaction">
<com:TActiveListBox
	OnSelectedIndexChanged="selectionChanged">
  <com:TListItem Value="value 1" Text="item 1" />
  <com:TListItem Value="value 2" Text="item 2" Selected="true" />
  <com:TListItem Value="value 3" Text="item 3" />
  <com:TListItem Value="value 4" Text="item 4" />
</com:TActiveListBox>
<com:TActiveLabel ID="SelectionResult" ForeColor="red" />
</td>
</tr>

</table>


<h2>Changing items to a Listbox on callback</h2>

<table class="sampletable">

<tr>
<td class="samplenote">
Adding an item on every callback:
  </td>
  <td class="sampleaction">
    <com:TActiveListBox ID="box1" />
    <com:TActiveButton ID="button1" Text="add a new item" OnCallback="buttonClicked" />
    <com:TActiveLabel ID="label1" ForeColor="red" />
  </td>
</tr>

</table>

<table class="sampletable">

<tr>
<td class="samplenote">
Clearing / restoring the listbox on callback:
  </td>
  <td class="sampleaction">
    <com:TActiveListBox ID="box2" />
    <com:TActiveButton ID="button2" Text="clear" OnCallback="clearClicked" />
    <com:TActiveButton ID="button3" Text="reset" OnCallback="resetClicked" />
    <com:TActiveLabel ID="label2" ForeColor="red" />
  </td>
</tr>

</table>

<h2>List Boxes with Validation</h2>

<table class="sampletable">

<tr>
<td class="samplenote">
Listbox is being validated:
</td>
<td class="sampleaction">
<com:TActiveListBox ID="VDropDownList1">
  <com:TListItem Value="value 1" Text="item 1" />
  <com:TListItem Value="value 2" Text="item 2" />
  <com:TListItem Value="value 3" Text="item 3" />
  <com:TListItem Value="value 4" Text="item 4" />
</com:TActiveListBox>
<com:TRequiredFieldValidator
	ControlToValidate="VDropDownList1"
	ErrorMessage="You must make a selection other than the first option"
	InitialValue="value 1"
	Display="Dynamic"
	ValidationGroup="Group1"
	/>
<com:TActiveButton Text="Submit" ValidationGroup="Group1" />
</td>
</tr>

<tr>
<td class="samplenote">
Listbox causing validation:
</td>
<td class="sampleaction">
<com:TTextBox ID="TextBox" />
<com:TRequiredFieldValidator
	ControlToValidate="TextBox"
	ErrorMessage="You must enter a value"
	Display="Dynamic"
	ValidationGroup="Group2"
	/>
<com:TActiveListBox
	ID="VDropDownList2"
	ValidationGroup="Group2">
  <com:TListItem Text="Agree" />
  <com:TListItem Text="Disagree" />
</com:TActiveListBox>
</td>
</tr>

</table>

<h2>List Boxes in Multiple Selection Mode</h2>
<i>Use Ctrl + Mouse Click to change selection</i>
<br/>

<table class="sampletable">

<tr>
<td class="samplenote">
Multiple items can be selected together:
  </td>
  <td class="sampleaction">
    <com:TActiveListBox
    	ID="MDropdownList"
    	SelectionMode="Multiple"
    	OnSelectedIndexChanged="multiSelectionChanged"
	>
  <com:TListItem Value="value 1" Text="item 1" />
  <com:TListItem Value="value 2" Text="item 2" />
  <com:TListItem Value="value 3" Text="item 3" />
  <com:TListItem Value="value 4" Text="item 4" />
</com:TActiveListBox>
<com:TActiveLabel ID="MSelectionResult" ForeColor="red" />
  </td>
</tr>

</table>
</com:TContent>