protected function dtgDepreciationClass_Bind() { $this->dtgDepreciationClass->TotalItemCount = DepreciationClass::CountAll(); if ($this->dtgDepreciationClass->TotalItemCount == 0) { $this->dtgDepreciationClass->ShowHeader = false; } else { $this->dtgDepreciationClass->DataSource = DepreciationClass::LoadAll(); $this->dtgDepreciationClass->ShowHeader = true; } }