4 Replies Latest reply on Feb 24, 2008 11:50 PM by wincxp

    When set dataGrid showHeader = false, dataGrid.rowCount then +1, this bug can solve?

    wincxp
      When I set DataGrid.showHeader=false, then DataGrid.rowCount+1.

      My code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">
      <mx:Script><![CDATA[
      import mx.collections.ArrayCollection;

      [Bindable]
      private var Arc:ArrayCollection = new ArrayCollection([
      {a:1,b:12,c:13},{a:2,b:22,c:23},{a:3,b:32,c:33}]);
      [Bindable]
      private var RowCount:int = 3;

      ]]></mx:Script>

      <mx:DataGrid id="DtgShowHeader" dataProvider="{Arc}" rowCount="{RowCount}" horizontalGridLines="true" horizontalGridLineColor="black"
      showHeaders="true">
      <mx:columns>
      <mx:DataGridColumn dataField="a" headerText="a"/>
      <mx:DataGridColumn dataField="b" headerText="b"/>
      <mx:DataGridColumn dataField="c" headerText="c"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:Label id="LblDtgShowHeaderRowCount"/>
      <mx:Button label="ShowHeader=True RowCount" click="LblDtgShowHeaderRowCount.text = 'DtgShowHeader.RowCount=' + DtgShowHeader.rowCount.toString();"/>

      <mx:DataGrid id="DtgHiddenHeader" dataProvider="{Arc}" rowCount="{RowCount}" horizontalGridLines="true" horizontalGridLineColor="black"
      showHeaders="false">
      <mx:columns>
      <mx:DataGridColumn dataField="a" headerText="a"/>
      <mx:DataGridColumn dataField="b" headerText="b"/>
      <mx:DataGridColumn dataField="c" headerText="c"/>
      </mx:columns>
      </mx:DataGrid>
      <mx:Label id="LblDtgHiddenHeaderRowCount"/>
      <mx:Button label="ShowHeader=False RowCount" click="LblDtgHiddenHeaderRowCount.text = 'DtgHideenHeader.RowCount=' + DtgHiddenHeader.rowCount.toString();"/>


      </mx:Application>

      Anyone meet this problem?