2 Replies Latest reply on Mar 8, 2007 3:16 PM by ntsiii

    items in dataGrid

    AdobeBuddy
      Hello EveryOne

      I've datagrid & it is binded to dataProvider.

      when it displays data. I want to count the no. of rows visible.
      or should I say, i would like count items in datagrid similar as we do in .NET

      can anyOne help me.

      Thanks
        • 1. Re: items in dataGrid
          BLXWebMaster Level 1
          When you say visible, do you mean visible without the additional items that might be displayed below the Scroll bar, or simply the total number of items?

          If you are looking to get the total number of items in the entire grid...
          I am assuming that you are populating the Grid using an array, if so just use length.

          {arrayName.length.toString()}


          • 2. Re: items in dataGrid
            ntsiii Level 3
            First this forum is intended for questions about Flex Builder. Flex language questions should be posted in the Flex General Discussion forum.

            Also, do not use Array as a dataProvider unless you are certain you will never be updating the data dynamically. Array does not dispatch the events necessary to cause the bound controls to update. Instead, use ArrayCollection. (or XML or XMLListCollection)

            A safe, generic way to get the length is: myDataGrid.dataProvider.length;

            Tracy