summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index ac22fb9c..eceb498b 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -106,7 +106,7 @@ Prado::using('System.Web.UI.WebControls.TTable');
* @package System.Web.UI.WebControls
* @since 3.0
*/
-class TDataGrid extends TBaseDataList
+class TDataGrid extends TBaseDataList implements INamingContainer
{
private $_columns=null;
private $_autoColumns=null;
@@ -820,7 +820,6 @@ class TDataGrid extends TBaseDataList
$ds->setDataSource(new TDummyDataSource($itemCount));
else
$ds->setDataSource(new TDummyDataSource($this->getViewState('DataSourceCount',0)));
-
$columns=new TList($this->getColumns());
$columns->mergeWith($this->_autoColumns);
@@ -879,12 +878,14 @@ class TDataGrid extends TBaseDataList
if($allowPaging && $ds->getCurrentPageIndex()>=$ds->getPageCount())
throw new TInvalidDataValueException('datagrid_currentpageindex_invalid');
// get all columns
- $columns=new TList($this->getColumns());
if($this->getAutoGenerateColumns())
{
+ $columns=new TList($this->getColumns());
$autoColumns=$this->createAutoColumns($ds);
$columns->mergeWith($autoColumns);
}
+ else
+ $columns=$this->getColumns();
$items=$this->getItems();