* @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package Prado\Web\UI\WebControls */ namespace Prado\Web\UI\WebControls; /** * TDataGridColumnCollection class. * * TDataGridColumnCollection represents a collection of data grid columns. * * @author Qiang Xue * @package Prado\Web\UI\WebControls * @since 3.0 */ class TDataGridColumnCollection extends TList { /** * the control that owns this collection. * @var TControl */ private $_o; /** * Constructor. * @param TDataGrid the control that owns this collection. */ public function __construct(TDataGrid $owner) { $this->_o=$owner; } /** * @return TDataGrid the control that owns this collection. */ protected function getOwner() { return $this->_o; } /** * Inserts an item at the specified position. * This overrides the parent implementation by inserting only TDataGridColumn. * @param integer the speicified position. * @param mixed new item * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridColumn. */ public function insertAt($index,$item) { if($item instanceof TDataGridColumn) { $item->setOwner($this->_o); parent::insertAt($index,$item); } else throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required'); } }