5 Replies Latest reply on May 9, 2010 11:08 PM by Sameer Bhatt

    AdvancedDataGrid grouping/scrolling bug?

    jim1234 Level 1

      I have an advanceddatagrid as a tree view.  I am using groupingcollection to group the items from datasource that is flat.  After it displays, if you click on each node to expand it, once it expands below the height of the grid, the scrollbar does not show.  If you then collapse and expand one of the nodes the scrollbar finally does show.  This works if you use a hierarchical data set without the groupingcollection, but my dataset is flat.  I'm looking for 1.  confirmation of this bug, and 2. A workaround.  Any help appreciated.  Below is the code to reproduce the problem:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">

      <mx:Script>
            
        <![CDATA[
         import mx.collections.ArrayCollection;
         import mx.collections.HierarchicalData;
         import mx.collections.XMLListCollection;
        
         [Bindable]
         public var dataList:ArrayCollection = new ArrayCollection([{Region:"Arizona",
          Territory_Rep:"Barbara Jennings",
                Actual:"38865", Estimate:"40000"},
          {Region:"Arizona", Territory_Rep:"Dana Binn",
                Actual:"29885", Estimate:"30000"},
         {Region:"Central California",
          Territory_Rep:"Joe Smith",
                Actual:"29134", Estimate:"30000"},
         {Region:"Nevada",
          Territory_Rep:"Bethany Pittman",
                Actual:"52888", Estimate:"45000"},
         {Region:"Northern California",
          Territory_Rep:"Lauren Ipsum",
                Actual:"38805", Estimate:"40000"},
          {Region:"Northern California",Territory_Rep:"T.R. Smith",
                Actual:"55498", Estimate:"40000"},
         {Region:"Southern California",
          Territory_Rep:"Alice Treu",
                Actual:"44985", Estimate:"45000"},
          {Region:"Southern California", Territory_Rep:"Jane Grove",
                Actual:"44913", Estimate:"45000"}]);
        
        ]]>
       
      </mx:Script>
         <mx:AdvancedDataGrid width="100%" height="250" designViewDataType="tree" creationComplete="gc.refresh()" >
         <mx:dataProvider>
          <mx:GroupingCollection2 id="gc" source="{dataList}">
           <mx:Grouping>
            <mx:GroupingField name="Region"/>
           </mx:Grouping>
          </mx:GroupingCollection2>
         </mx:dataProvider>
          <mx:columns>
           <mx:AdvancedDataGridColumn dataField="Region"
                    headerText="Region"/>
           <mx:AdvancedDataGridColumn dataField="Territory_Rep"
                    headerText="Territory Rep"/>
           <mx:AdvancedDataGridColumn dataField="Actual"
                    headerText="Actual"/>
           <mx:AdvancedDataGridColumn dataField="Estimate"
                    headerText="Estimate"/>
          </mx:columns>
         </mx:AdvancedDataGrid>

      </mx:Application>