4 Replies Latest reply on Apr 14, 2007 11:18 AM by gerdzhik

    Rendering checkbox in header of a data grid column

    Cheree Singal Level 1
      Hi,
      I want to render the header of a datagrid column with a checkbox. I am using headerRenderer property but its not working.

      Here's my code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">
      <mx:VBox horizontalAlign="center">
      <mx:DataGrid width="98%" editable="true">
      <mx:columns>
      <mx:DataGridColumn headerText="1" width="35" editable="false"/>
      <mx:DataGridColumn editable="true" width="40">
      <mx:headerRenderer>
      <mx:Component>
      <mx:CheckBox/>
      </mx:Component>
      </mx:headerRenderer>
      </mx:DataGridColumn>
      <mx:DataGridColumn headerText="3" width="80" editable="false"/>
      <mx:DataGridColumn headerText="4" width="150" editable="false"/>
      <mx:DataGridColumn width="80" headerText="5" editable="false"/>
      <mx:DataGridColumn width="150" headerText="6" editable="false"/>
      <mx:DataGridColumn width="60" headerText="7" editable="false"/>
      <mx:DataGridColumn width="80" headerText="8" editable="false"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:VBox>
      </mx:Application>



      I am getting following exception on running it:

      ReferenceError: Error #1069: Property null not found on mx.controls.dataGridClasses.DataGridColumn and there is no default value.
      at mx.controls::Button/set data()
      at mx.controls::DataGrid/::calculateHeaderHeight()
      at mx.controls::DataGrid/mx.controls:DataGrid::makeRowsAndColumns()
      at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::updateDisplayList()
      at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList()
      at mx.core::UIComponent/validateDisplayList()
      at mx.managers::LayoutManager/::validateDisplayList()
      at mx.managers::LayoutManager/::doPhasedInstantiation()
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/::callLaterDispatcher2()
      at mx.core::UIComponent/::callLaterDispatcher()


      Plz tell me how to correct it.

      Thanks in advance,
      Cheree