1 Reply Latest reply on Aug 27, 2007 5:26 PM by rvollmar

    DataGrid data display problem

    Handycam Level 1
      I have an array collection:
      dgData =1.25,cups,dried cranberry beans (borlotti),.25,lbs,bulk pancetta, cut into small dice,.5,cups,chopped shallots,.5,cups,chopped leeks,0.25,cups,chopped celery,0.25,cups,chopped onions,.25,tsp,chopped fresh marjoram,.25,tsp,Dried herbes de provence,.25,tsp,minced fresh ginger,.25,tsp,ground coriander,.25,tsp,sweet paprika (smoked or plain),.25,tsp,ground fennel seed,1,Tbs,tomato paste,1,cups,chopped carrots (1/4-inch-thick half-moons),1,cups,coarsely chopped escarole,1,cups,peeled, diced parsnips (1/2-inch dice),5,cups,homemade or low-sodium canned chicken broth,1.5,tsp,champagne vinegar,.25,Tbs,chopped parsley,.25,Tbs,chopped cilantro,1,cup,herb-infused oil, for drizzling

      Each set of 3 is its own array, e.g. .5,cups,chopped shallots

      I can assign it to my grid, as in
      <mx:DataGrid id="rgGrid" width="100%" dataProvider="{_dgData}" selectable="false" wordWrap="true" >
      <mx:columns>
      <mx:DataGridColumn dataField="0" headerText="Amount" width="40"/>
      <mx:DataGridColumn dataField="1" headerText="Units" width="50" />
      <mx:DataGridColumn dataField="2" headerText="Ingredient" />
      </mx:columns>
      </mx:DataGrid>

      My problem is the DISPLAY of the items. I have found that if the data grid is not tall enough (i.e. it scrolls) then the display of these items is incorrect. There are multiple entries, missing entries etc. If I make the grid tall enough, like 500, they all display, perfectly.

      What the heck is going on here?
        • 1. Re: DataGrid data display problem
          rvollmar Level 1
          Hello,

          With the following code, it looks fine. Could you please paste the code for a complete app. which shows the problem?

          Thanks,
          - Rob

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application width="100%" height="100%" xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="doCreationComplete()" >

          <mx:Script>
          <![CDATA[

          import mx.collections.*;
          import mx.controls.dataGridClasses.DataGridColumn;

          private var colArr:Array;
          [Bindable] private var dataAC:ArrayCollection;

          private function doCreationComplete():void{
          setUpDataProvider();
          }

          private function setUpDataProvider():void{
          dataAC = new ArrayCollection();

          dataAC.addItem({ amount:"1.25", unit:"cups", ingredient:"dried cranberry beans (borlotti)"});
          dataAC.addItem({ amount:".25", unit:"lbs", ingredient:"bulk pancetta, cut into small dice"});
          dataAC.addItem({ amount:".5", unit:"cups", ingredient:"chopped shallots"});
          dataAC.addItem({ amount:"1.25", unit:"cups", ingredient:"dried cranberry beans (borlotti)"});
          dataAC.addItem({ amount:".25", unit:"lbs", ingredient:"bulk pancetta, cut into small dice"});
          dataAC.addItem({ amount:".5", unit:"cups", ingredient:"chopped shallots"});
          dataAC.addItem({ amount:"1.25", unit:"cups", ingredient:"dried cranberry beans (borlotti)"});
          dataAC.addItem({ amount:".25", unit:"lbs", ingredient:"bulk pancetta, cut into small dice"});
          dataAC.addItem({ amount:".5", unit:"cups", ingredient:"chopped shallots"});
          dataAC.addItem({ amount:"1.25", unit:"cups", ingredient:"dried cranberry beans (borlotti)"});
          dataAC.addItem({ amount:".25", unit:"lbs", ingredient:"bulk pancetta, cut into small dice"});
          dataAC.addItem({ amount:".5", unit:"cups", ingredient:"chopped shallots"});
          dataAC.addItem({ amount:"1.25", unit:"cups", ingredient:"dried cranberry beans (borlotti)"});
          dataAC.addItem({ amount:".25", unit:"lbs", ingredient:"bulk pancetta, cut into small dice"});
          dataAC.addItem({ amount:".5", unit:"cups", ingredient:"chopped shallots"});
          }

          ]]>
          </mx:Script>

          <mx:DataGrid id="rgGrid" width="100%" dataProvider="{dataAC}" selectable="false" wordWrap="true" >
          <mx:columns>
          <mx:DataGridColumn dataField="amount" headerText="Amount" width="40"/>
          <mx:DataGridColumn dataField="unit" headerText="Unit" width="50" />
          <mx:DataGridColumn dataField="ingredient" headerText="Ingredient" />
          </mx:columns>
          </mx:DataGrid>

          </mx:Application>