summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.page15
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.php6
2 files changed, 20 insertions, 1 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.page b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.page
index c94f581d..6de3063a 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.page
@@ -8,7 +8,6 @@
CellPadding="2"
ID="DataGrid"
AutoGenerateColumns="false"
- EnableViewState="false"
HeaderStyle.BackColor="black"
HeaderStyle.ForeColor="white"
ItemStyle.BackColor="#BFCFFF"
@@ -48,4 +47,18 @@
</com:TTemplateColumn>
</com:TDataGrid>
+<com:TPanel GroupingText="Column Visibility" Width="200px">
+
+<com:TCheckBoxList
+ AutoPostBack="true"
+ OnSelectedIndexChanged="toggleColumnVisibility">
+ <com:TListItem Text="Book Title" Selected="true" />
+ <com:TListItem Text="Publisher" Selected="true" />
+ <com:TListItem Text="Price" Selected="true" />
+ <com:TListItem Text="In-stock" Selected="true" />
+ <com:TListItem Text="Rating" Selected="true" />
+</com:TCheckBoxList>
+
+</com:TPanel>
+
</com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.php b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.php
index 16a32c28..03795910 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.php
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample2.php
@@ -73,6 +73,12 @@ class Sample2 extends TPage
$this->DataGrid->dataBind();
}
}
+
+ public function toggleColumnVisibility($sender,$param)
+ {
+ foreach($this->DataGrid->Columns as $index=>$column)
+ $column->Visible=$sender->Items[$index]->Selected;
+ }
}
?> \ No newline at end of file