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

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