2 Replies Latest reply on Jun 21, 2011 8:12 AM by Scott R. Hamilton

    Datagrid rowCount property not being set at run time

    Scott R. Hamilton Level 1

      My app shows  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 derive from the number of elements in the  data provider -  could this be the problem?