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

<h1>TDataGrid Sample 3</h1>
<h2>Interacting with TDataGrid</h2>

<com:TDataGrid
	Width="800px"
	CellPadding="2"
	ID="DataGrid"
	DataKeyField="ISBN"
	AutoGenerateColumns="false"
	HeaderStyle.BackColor="black"
	HeaderStyle.ForeColor="white"
	ItemStyle.BackColor="#BFCFFF"
	ItemStyle.Font.Italic="true"
	AlternatingItemStyle.BackColor="#E6ECFF"
	EditItemStyle.BackColor="lightyellow"
	OnItemCreated="itemCreated"
	OnEditCommand="editItem"
	OnUpdateCommand="saveItem"
	OnCancelCommand="cancelItem"
	OnDeleteCommand="deleteItem"
	>

	<com:TBoundColumn
		ID="BookTitleColumn"
		HeaderText="Book Title"
		HeaderStyle.Width="400px"
		DataField="title"
		/>
	<com:TBoundColumn
		ID="PublisherColumn"
		HeaderText="Publisher"
		HeaderStyle.Width="150px"
		DataField="publisher"
		/>
	<com:TBoundColumn
		ID="PriceColumn"
		ItemStyle.HorizontalAlign="Right"
		ItemStyle.Wrap="false"
		ItemStyle.Font.Italic="false"
		ItemStyle.ForeColor="green"
		HeaderText="Price"
		HeaderStyle.Width="70px"
		DataField="price"
		DataFormatString="$%.2f"
		/>
	<com:TCheckBoxColumn
		ID="InStockColumn"
		HeaderText="In-stock"
		DataField="instock"
		/>
	<com:TTemplateColumn ID="RatingColumn" HeaderText="Rating">
		<prop:ItemTemplate>
		<img src="images/star<%#$this->Parent->DataItem['rating']%>.gif" alt="" />
		</prop:ItemTemplate>
		<prop:EditItemTemplate>
		<com:TDropDownList
			SelectedValue=<%#$this->Parent->DataItem['rating'] %>
			ID="Rating">
			<com:TListItem Value="1" />
			<com:TListItem Value="2" />
			<com:TListItem Value="3" />
			<com:TListItem Value="4" />
			<com:TListItem Value="5" />
		</com:TDropDownList>
		</prop:EditItemTemplate>
	</com:TTemplateColumn>
	<com:TEditCommandColumn
		HeaderText="Edit"
		HeaderStyle.Width="100px"
		UpdateText="Save"
		ItemStyle.HorizontalAlign="Center"
		ItemStyle.Font.Italic="false"
		/>
	<com:TButtonColumn
		ID="DeleteColumn"
		HeaderText="Delete"
		HeaderStyle.Width="50px"
		ItemStyle.HorizontalAlign="Center"
		ItemStyle.Font.Italic="false"
		Text="Delete"
		CommandName="delete"
		/>
</com:TDataGrid>

</com:TContent>