3 Replies Latest reply on Apr 10, 2007 8:09 AM by rbk12345

    Checked CheckBoxes moving around in DataGrid

    Dean Schulze
      I have a DataGrid and I use a CheckBox as a custom ItemRenderer/ItemEditor. I make the CheckBox a custom renderer so I can disable it in certain rows depending on the value of the data in that row.

      When I select a few check boxes in the DataGrid and then scroll through the DataGrid other CheckBoxes that I did not check will show a check. Even some of the disabled CheckBoxes will show a check mark.

      The data binding works properly no matter how screwed up the rendering is. Only the CheckBoxes that I actually check show up as checked in the data. It is just the rendering that is screwed up.

      Here is my code from the DataGrid and my custom renderer:
      <mx:DataGridColumn
      id="distributeCB"
      rendererIsEditor="true"
      headerText="Distribute"
      width="70"
      dataField="distribute"
      editorDataField="selected"
      itemRenderer="com.avaya.im.decm.branches.CheckBoxItemRenderer" />


      <?xml version="1.0" encoding="utf-8"?>
      <mx:CheckBox
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      enabled="{data.status==notDistributedStr}"
      change="data.distribute=selected" >


      <mx:Script>
      <![CDATA[

      // Must match BranchCoveragePathTemplates.NOT_DISTRIBUTEDD
      public const notDistributedStr:String = "Not Distributed";
      ]]>
      </mx:Script>

      </mx:CheckBox>


      Has anyone seen this and solved it?

      Thanks.