From 47a3cb88e7ed7f2a87bbf024dff3416fc6cd8002 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Thu, 31 Aug 2006 20:17:39 +0000
Subject: merge from 3.0 branch till 1374.
---
.../protected/pages/Controls/DataGrid.page | 4 +++-
.../pages/Controls/Samples/TDataGrid/Sample3.page | 28 ++++++++++------------
.../pages/Controls/Samples/TDataGrid/Sample3.php | 2 +-
3 files changed, 16 insertions(+), 18 deletions(-)
(limited to 'demos')
diff --git a/demos/quickstart/protected/pages/Controls/DataGrid.page b/demos/quickstart/protected/pages/Controls/DataGrid.page
index 392b78ab..2a51a3de 100644
--- a/demos/quickstart/protected/pages/Controls/DataGrid.page
+++ b/demos/quickstart/protected/pages/Controls/DataGrid.page
@@ -22,6 +22,7 @@ PRADO provides five types of columns:
- TBoundColumn associates cells with a specific field of data and displays the cells according to their modes.
- TCheckBoxColumn associates cells with a specific field of data and displays in each cell a checkbox whose check state is determined by the data field value.
+ - TDropDownListColumn associates cells with a specific field of data and displays the cells according to their modes. If in edit mode, a cell will be displayed with a TDropDownList.
- THyperLinkColumn displays in the cells a hyperlink whose caption and URL can be either statically specified or bound to some fields of data.
- TEditCommandColumn displays in the cells edit/update/cancel command buttons according to the state of the item that a cell resides in.
- TButtonColumn displays in the cells a command button.
@@ -114,7 +115,8 @@ The following example uses manually specified columns to show a list of book inf
Besides the rich data presentation functionalities as demonstrated in previous section, TDataGrid is also highly user interactive. An import usage of TDataGrid is editing or deleting rows of data. The TBoundColumn can adjust the associated cell presentation according to the mode of datagrid items. When an item is in browsing mode, the cell is displayed with a static text; when the item is in editing mode, a textbox is displayed to collect user inputs. TDataGrid provides TEditCommandColumn for switching item modes. In addition, TButtonColumn offers developers the flexibility of creating arbitrary buttons for various user interactions.
-The following example shows how to make the previous book information table an interactive one. It allows users to edit and delete book items from the table. Two additional columns are used in the example to allow users interact with the datagrid: TEditCommandColumn and TButtonColumn.
+The following example shows how to make the previous book information table an interactive one. It allows users to edit and delete book items from the table. Two additional columns are used in the example to allow users interact with the datagrid: TEditCommandColumn and TButtonColumn. In addition,
+TDropDownListColumn replaces the previous TTemplateColumn to allow users to select a rating from a dropdown list. Note, it is also possible to use TTemplateColumn to achieve the same task.
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
index 96affa4a..5fb19c6f 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
@@ -50,22 +50,18 @@
HeaderText="In-stock"
DataField="instock"
/>
-
-
-
-
-
- Parent->DataItem['rating'] %>
- ID="Rating">
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
PublisherColumn->TextBox->Text, // publisher
$item->PriceColumn->TextBox->Text, // price
$item->InStockColumn->CheckBox->Checked, // instock
- $item->RatingColumn->Rating->SelectedValue // rating
+ $item->RatingColumn->DropDownList->SelectedValue // rating
);
$this->DataGrid->EditItemIndex=-1;
$this->DataGrid->DataSource=$this->Data;
--
cgit v1.2.3