2 Replies Latest reply on Jun 22, 2011 10:48 AM by Scott R. Hamilton

    Datagrid rowCount property not being set at run time

    Scott R. Hamilton Level 1

      My app contains a Datagrid on a print form that should only display the number of rows for which there are elements in the data provider.


      I'm trying to set the rowCount property equal to the length of the data provider collection.


              formPrintView.dgPrtRecIngr.rowCount = dgIngrData.length


              trace("dgIngrData.length: " +dgIngrData.length + "   formPrintView.dgPrtRecIngr.rowCount: " + formPrintView.dgPrtRecIngr.rowCount)


              Trace output in the dbg console:

              dgIngrData.length: 7   formPrintView.dgPrtRecIngr.rowCount: 7


      The trace is showing both ...rowCount and ...length to be 7 but the number of displayed rows in the print form is 10 which means that three
      empty rows are displayed thus wasting space on the form.



      I'm also setting the rowHeight based on a calculation derived from the number of elements in the  data provider -  could this be the problem?