title: I cant display value in CGRIDVIEW with HAS_MANY relasionship (Yii)
body: <p>I have 2 table: 
  "tblcongvanden" (ID, tencongvan) (1)-------&lt;- (n) "tblcanbothuchien" (ID, maCongVan(FK), maCanBo, daXem)</p>
  
  <p>In congvanden's model (of tblcongvanden table), i have a relation:</p>
  
  <pre><code>public function relations() {
      return array(
          'canbothuchien' =&gt; array(self::HAS_MANY,'canbothuchien','maCongVan'),
          'mucdomat' =&gt; array(self::BELONGS_TO,'mucdomat','maMucDoMat'),
      );
  }
  </code></pre>
  
  <p>and i have a function </p>
  
  <pre><code>public function dsCVDchuaXem(){
      $userid = canbo::model()-&gt;find('tenDangNhap=:ten',array(':ten'=&gt;Yii::app()-&gt;user-&gt;id))-&gt;ID;
  
      $criteria = new CDbCriteria;
      $criteria-&gt;with= array('canbothuchien','mucdomat');
      $criteria-&gt;condition = 'maCanBo=:ma';
      $criteria-&gt;params= array(':ma'=&gt;$userid);
  
      $criteria-&gt;compare('t.ID',$this-&gt;ID);
      $criteria-&gt;compare('tieuDe',$this-&gt;tieuDe,true);
      $criteria-&gt;compare('soDen',$this-&gt;soDen,true);
  
      $rev=$this-&gt;ngayDen;
      $rev = preg_replace('/^(\d{1,2})-(\d{1,2})-(\d{2,4})$/',"$3-$2-$1",$rev); //for day-month-year
      $criteria-&gt;compare('ngayDen', $rev,true);
  
      $rev=$this-&gt;ngayThang;
      $rev = preg_replace('/^(\d{1,2})-(\d{1,2})-(\d{2,4})$/',"$3-$2-$1",$rev); //for day-month-year
      $criteria-&gt;compare('ngayThang', $rev,true);
  
      $criteria-&gt;compare('maMucDoMat',$this-&gt;maMucDoMat);
      $criteria-&gt;together = true;
  
      return new CActiveDataProvider($this, array(
          'pagination'=&gt; array(
              'pageSize'=&gt; 10
          ),
          'criteria'=&gt;$criteria,
      ));
  }
  </code></pre>
  
  <p>In the index.php, how to display the field "daXem" in the Cgridview?</p>
  
  <p>(I typed <code>'value'=&gt;'$data-&gt;canbothuchien[0]-&gt;daXem'</code> and the error is "Trying to get property of non-object ", or if i typed <code>"value'=&gt;'$data-&gt;canbothuchien-&gt;daXem"</code> it's error too)</p>