How to obtain the total data rows of A DataGrid

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.