In Flex, there is a public property: rowcount, which is "the number of rows that are at least partially visible in the list" and cannot obtain the total number of rows. In addition, it seems that there are no attributes or methods. You can directly obtain the total number of data rows of the DG. Searching in the database is simple.
Later, I found that if selectedindex is set to be greater than the total number of data rows, the index points to the last row of the Data row. Then a curve method is obtained to obtain the data row of the DG data.
VaR selectedrow: int;
VaR tempcount: Int = 1000;
VaR rcount: int;
Selectedrow = DG. selectedindex;
DG. selectedindex = tempcount;
Rcount = DG. selectedindex + 1;
DG. selectedindex = selectedrow;
Rcount indicates the total number of rows. Because index starts from 0, you must add one.
Tempcount is set to a number that is more than the number of rows by default.