internal void UpdateIndexes()
        {
            _oldSelectedSlotsTable.Clear();
            _selectedSlotsTable.Clear();

            if (this.OwningGrid.DataConnection.DataSource == null)
            {
                if (this.SelectedItemsCache.Count > 0)
                {
                    this.OwningGrid.SelectionHasChanged = true;
                    this.SelectedItemsCache.Clear();
                }
            }
            else
            {
                List <object> tempSelectedItemsCache = new List <object>();
                foreach (object item in _selectedItemsCache)
                {
                    int index = this.OwningGrid.DataConnection.IndexOf(item);
                    if (index != -1)
                    {
                        tempSelectedItemsCache.Add(item);
                        _selectedSlotsTable.AddValue(this.OwningGrid.SlotFromRowIndex(index), true);
                    }
                }

                foreach (object item in _oldSelectedItemsCache)
                {
                    int index = this.OwningGrid.DataConnection.IndexOf(item);
                    if (index == -1)
                    {
                        this.OwningGrid.SelectionHasChanged = true;
                    }
                    else
                    {
                        _oldSelectedSlotsTable.AddValue(this.OwningGrid.SlotFromRowIndex(index), true);
                    }
                }

                _selectedItemsCache = tempSelectedItemsCache;
            }
        }
 internal void ClearRows()
 {
     _selectedSlotsTable.Clear();
     _selectedItemsCache.Clear();
 }