///<summary>
        /// GridVirtualRowList
        ///</summary>
        ///<param name="container"></param>
        public GridVirtualRows(GridContainer container)
        {
            _Container = container;

            _PageBuckets = new VPageBucket[MaxBuckets];
            _PageBuckets[0] = new VPageBucket(_Container, 0);
        }
        private void TruncateRowIndex(int index)
        {
            _LastAccessedBucket = null;

            for (int i = 0; i < MaxBuckets; i++)
            {
                int n = (_BucketHead + i) % MaxBuckets;

                if (_PageBuckets[n] != null)
                {
                    if (_PageBuckets[n].StartIndex >= index)
                        _PageBuckets[n] = null;

                    else if (_PageBuckets[n].EndIndex > index)
                    {
                        for (int j = 0; j < MaxRows; j++)
                        {
                            if (_PageBuckets[n].StartIndex + j > index)
                                _PageBuckets[n].Rows[j] = null;
                        }
                    }
                }
            }
        }
        ///<summary>
        /// Clear
        ///</summary>
        public void Clear()
        {
            for (int i = 0; i < MaxBuckets; i++)
            {
                if (_PageBuckets[i] != null)
                    _PageBuckets[i].Reset(null, 0);

                _PageBuckets[i] = null;
            }

            _BucketHead = 0;
            _LastAccessedBucket = null;
        }
        private GridRow NewBucketRow(int n, int index)
        {
            int startIndex = (index / MaxRows) * MaxRows;

            if (_PageBuckets[n] != null)
                _PageBuckets[n].Reset(_Container, startIndex);
            else
                _PageBuckets[n] = new VPageBucket(_Container, startIndex);

            _LastAccessedBucket = _PageBuckets[n];

            return (_LastAccessedBucket[index]);
        }
        private GridRow GetRow(int index)
        {
            if (_LastAccessedBucket != null)
            {
                if (_LastAccessedBucket.Contains(index))
                    return (_LastAccessedBucket[index]);
            }

            for (int i = 0; i < MaxBuckets; i++)
            {
                int n = (_BucketHead + i) % MaxBuckets;

                if (_PageBuckets[n] == null)
                    return (NewBucketRow(n, index));

                if (_PageBuckets[n].Contains(index))
                {
                    _LastAccessedBucket = _PageBuckets[n];

                    return (_LastAccessedBucket[index]);
                }
            }

            int bucket = _BucketHead;

            GridPanel panel = _Container.GridPanel;

            if (panel != null)
            {
                for (int i = 0; i < MaxBuckets; i++)
                {
                    bucket = (_BucketHead + i) % MaxBuckets;

                    if (panel.FrozenRowCount > 0)
                    {
                        if (_PageBuckets[bucket].Contains(0))
                            continue;
                    }

                    if (panel.ActiveRow != null)
                    {
                        if (_PageBuckets[bucket].Contains(panel.ActiveRow.Index))
                            continue;
                    }
                    break;
                }
            }

            _BucketHead = (bucket + 1) % MaxBuckets;

            return (NewBucketRow(bucket, index));
        }