0 Replies Latest reply on Jun 18, 2007 9:45 PM by raga_menon

    Error while using DataGrid

    raga_menon
      Hi All,

      Am new to flex and learning and doing the examples of flex applications.
      while using the data grid in my application am getting an error like this
      =====
      Multiple markers at this line --Access of undefined property RenderDGHeader and
      Definition headerRenderer="myComponents.RendererDGHeader could not be found..
      ====
      where RendererDGHeader is file which contains the
      ?xml version="1.0"?>
      <!-- itemRenderers\dataGrid\myComponents\RendererDGHeader.mxml -->
      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[

      [Embed(source="img1.jpg")]
      [Bindable]
      public var sale:Class;
      ]]>
      </mx:Script>

      <mx:Label text="Sale Price!"/>
      <mx:Image height="20" source="{sale}"/>

      </mx:HBox>
      ------------------------------------------------------------------
      and MainDGHeaderRenderer.mxml is the main file where am declaring the datagrid...

      <?xml version="1.0"?>
      <!-- itemRenderers\dataGrid\MainDGHeaderRenderer.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;

      [Bindable]
      private var initDG:ArrayCollection = new ArrayCollection([
      {Artist:'Pavement', Album:'Slanted and Enchanted',
      Price:11.99, SalePrice: true },
      {Artist:'Pavement', Album:'Brighten the Corners',
      Price:11.99, SalePrice: false }
      ]);
      ]]>
      </mx:Script>

      <mx:DataGrid id="myGrid"
      dataProvider="{initDG}"
      variableRowHeight="true">
      <mx:columns>
      <mx:DataGridColumn dataField="Artist"/>
      <mx:DataGridColumn dataField="Album"/>
      <mx:DataGridColumn dataField="Price"/>
      <mx:DataGridColumn width="150" dataField="SalePrice"
      headerRenderer="myComponents.RendererDGHeader"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Application>
      --------------------------------------------------------------------
      how can i ignore the error.. if anyone knows kindly inform how to achieve the error.

      Thanks,
      Raga.