protected virtual void DetachCells()
 {
     while (this.VisualCells.Count > 0)
     {
         GridCellElement visualCell = this.VisualCells[0];
         visualCell.Parent.Children.Remove((RadElement)visualCell);
         GridVirtualizedCellElement virtualizedCellElement = visualCell as GridVirtualizedCellElement;
         if (virtualizedCellElement != null)
         {
             this.TableElement.CellElementProvider.CacheElement((IVirtualizedElement <GridViewColumn>)virtualizedCellElement);
             virtualizedCellElement.Detach();
         }
         else
         {
             visualCell.Dispose();
         }
     }
 }
Beispiel #2
0
        private void Detach(
            IVirtualizedElementProvider <GridViewColumn> cellElementProvider,
            GridCellElement cell)
        {
            GridVirtualizedCellElement virtualizedCellElement = cell as GridVirtualizedCellElement;

            if (virtualizedCellElement != null)
            {
                cellElementProvider.CacheElement((IVirtualizedElement <GridViewColumn>)virtualizedCellElement);
                virtualizedCellElement.Detach();
                if (virtualizedCellElement.Parent == null || !virtualizedCellElement.Parent.Children.Contains((RadElement)virtualizedCellElement))
                {
                    return;
                }
                virtualizedCellElement.Parent.Children.Remove((RadElement)virtualizedCellElement);
            }
            else
            {
                cell.Dispose();
            }
        }