2 Replies Latest reply on Nov 30, 2006 6:33 AM by ur_dtrain

    mx:DataGrid.rowCount

    wy790289
      Hi Everybody,

      I just want to ask a question that is the rowCount property in dataGrid object will return the total rows in the data grid? I encounter a problem that I want to check each rows in the dataGrid in a function but the rowCount return incorrect number of rows of the grid. For example, I only have 5 rows in datagrid but the rowCount returns 7. Do I misunderstand the function of rowCount? if so, which property should I use to check the number of rows.

      Below is my function in program, you may assume the object "dg" is a dataGrid:

      private function sendEmail():void {
      var rows:int;
      var curRow:int;

      rows = dg.rowCount;
      Alert.show(rows.toString());
      for (curRow = 0; curRow < rows; curRow++) {
      dg.selectedIndex = curRow;
      if (dg.selectedItem.maillist == "Y") {
      textA.text = textA.text + curRow.toString() + " " + dg.selectedItem.email + "\n";
      }
      }
      }

      Thanks,
      Wilson