         //--------------------------------------------------------------------------
         
         /**
-         *  Selects all rows and removes the caret, if <code>selectionMode</code>  
-         *  is <code>GridSelectionMode.MULTIPLE_ROWS</code>, or all cells, if 
-         *  <code>selectionMode</code> is <code>GridSelectionMode.MULTIPLE_CELLS</code>.
-         *  For all other selection modes, this method has no effect.
-         *
-         *  <p>If rows or columns are inserted after this method is called, the 
-         *  new rows or cells will be selected.</p>
+         *  If <code>selectionMode</code> is 
+         *  <code>GridSelectionMode.MULTIPLE_ROWS</code>, selects all rows and
+         *  removes the caret or if <code>selectionMode</code> is 
+         *  <code>GridSelectionMode.MULTIPLE_CELLS</code> selects all cells  
+         *  and removes the caret.  For all other selection modes, this method 
+         *  has no effect.
+         *
+         *  <p>To clear the selection use <code>clearSelection</code>.</p>
+         * 
+         *  <p>If items are added to the <code>dataProvider</code> or 
+         *  <code>columns</code> are added after this method is called, the
+         *  new rows or cells in the new column will be selected.  This implicit
+         *  mode ends when the selection is cleared using 
+         *  <code>clearSelection</code> or reset using one of
+         *  <code>setSelectedCell</code>, <code>setSelectedCells</code>,
+         *  <code>setSelectedIndex</code>, <code>setSelectedIndices</code>.</p>
          * 
          *  @return True if the selection changed.
          *    
+         *  @see spark.components.Grid#clearSelection
+         *  @see spark.components.Grid#setSelectedCell
+         *  @see spark.components.Grid#setSelectedCells
+         *  @see spark.components.Grid#setSelectedIndex
+         *  @see spark.components.Grid#setSelectedIndices
+         * 
          *  @langversion 3.0
          *  @playerversion Flash 10
          *  @playerversion AIR 2.0

         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function selectionContainsIndex(index:int):Boolean 
        {
            return gridSelection.containsRow(index);
        }
        
        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_ROW</code>
         *  or <code>GridSelectionMode.MULTIPLE_ROWS</code>, returns true if the row 
         *  at <code>index></code> is in only item in current selection.
         * 
         *  <p>The <code>rowIndex</code> is the index in <code>dataProvider</code> 
         *  of the item containing the selected cell.</p>
         *
         *  @param rowIndex The 0-based row index of the row.
         * 
         *  @return True if the selection contains just this row.
         *    
         *  @see spark.components.Grid#dataProvider
         * 
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function selectionContainsOnlyIndex(index:int):Boolean 
        {
            return gridSelection.containsOnlyRow(index);
        }
        
        /**

        }    
        
        //----------------------------------
        //  selectedCell
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]

        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_CELL</code> 
         *  or <code>GridSelectionMode.MULTIPLE_CELLS</code>, returns the first
         *  selected cell starting at row 0 column 0 and progressing thru each
         *  column in a row before moving to the next row.
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         *
         *  @default null
         * 
         *  @return CellPosition of the first selected cell or null if there is
         *  no cell selection.
         *  
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedCell():CellPosition
        {
            var selectedCells:Vector.<CellPosition> = gridSelection.allCells();
            return selectedCells.length ? selectedCells[0] : null;
        }
                       
        //----------------------------------
        //  selectedCells
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]

        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_CELL</code> 
         *  or <code>GridSelectionMode.MULTIPLE_CELLS</code>, returns a Vector
         *  of CellPosition objects representing the positions of the selected
         *  cells in the grid.
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         * 
         *  @default []
         * 
         *  @return Vector of CellPosition objects where each element represents
         *  a selected cell.
         *  
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedCells():Vector.<CellPosition>
        {
            return gridSelection.allCells();
        }

        //----------------------------------
        //  selectedIndex
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]

        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_ROW</code> 
         *  or <code>GridSelectionMode.MULTIPLE_ROWS</code>, returns the
         *  rowIndex of the first selected row. 
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         *
         *  @default -1
         * 
         *  @return rowIndex of first selected row or -1 if there are no
         *  selected rows.
         *  
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedIndex():int
        {
            var selectedRows:Vector.<int> = gridSelection.allRows();
            return selectedRows.length ? selectedRows[0] : -1;
        }
        
        //----------------------------------
        //  selectedIndices
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]

        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_ROW</code> 
         *  or <code>GridSelectionMode.MULTIPLE_ROWS</code>, returns a Vector of 
         *  the selected rows indices.  For all other selection modes, this 
         *  method has no effect.
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         *
         *  @default []
         * 
         *  @return Vector of ints where each element is the index in 
         *  <code>dataProvider</code> of the selected row.
         *  
         *  @see spark.components.Grid#dataProvider
         * 
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedIndices():Vector.<int>
        {
            return gridSelection.allRows();
        }
        
        //----------------------------------
        //  selectedItem
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]
        
        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_ROW</code> 
         *  or <code>GridSelectionMode.MULTIPLE_ROWS</code>, returns the 
         *  item in the <code>dataProvider</code> that is currently selected or
         *  <code>undefined</code> if not rows are selected.  
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         *  @default undefined
         * 
         *  @return Vector of <code>dataProvider</code> items.
         *  
         *  @see spark.components.Grid#dataProvider
         * 
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedItem():Object
        {
            var rowIndex:int = selectedIndex;
            if (rowIndex == -1)
                return undefined;
            
            return getDataProviderItem(rowIndex);           
        }
        
        //----------------------------------
        //  selectedItems
        //----------------------------------
        
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]

        /**
         *  If <code>selectionMode</code> is <code>GridSelectionMode.SINGLE_ROW</code> 
         *  or <code>GridSelectionMode.MULTIPLE_ROWS</code>, returns a Vector of 
         *  the dataProvider items that are currently selected
         * 
         *  <p>When the user changes the selection by interacting with the 
         *  control, the control dispatches the <code>selectionChange</code> 
         *  event. When the user changes the selection programmatically, the 
         *  control dispatches the <code>valueCommit</code> event.</p>
         *  @default []
         * 
         *  @return Vector of <code>dataProvider</code> items.
         *  
         *  @see spark.components.Grid#dataProvider
         * 
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.0
         *  @productversion Flex 4.5
         */
        public function get selectedItems():Vector.<Object>
        {
            var rowIndices:Vector.<int> = selectedIndices;
            if (rowIndices.length == 0)
                return undefined;
            
            var items:Vector.<Object> = new Vector.<Object>();
            
            for each (var rowIndex:int in rowIndices)        
                items.push(dataProvider.getItemAt(rowIndex));
           
            return items;
        }
        
        //----------------------------------
        //  selectionIndicator
        //----------------------------------
        
