Пример #1
0
        /// <summary>
        /// Fired when a cell is added from the selection or removed from the selection
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnSelectionChange(SelectionChangeEventArgs e)
        {
//			#warning Temporaneo
//			if (e.EventType == SelectionChangeEventType.Add)
//				System.Diagnostics.Debug.WriteLine("Selection.AddRange " + e.Range.ToString());
//			else if (e.EventType == SelectionChangeEventType.Remove)
//				System.Diagnostics.Debug.WriteLine("Selection.RemoveRange " + e.Range.ToString());
//			else if (e.EventType == SelectionChangeEventType.Clear)
//				System.Diagnostics.Debug.WriteLine("Selection.Clear");

            ClearCache();

            if (e.EventType == SelectionChangeEventType.Add || e.EventType == SelectionChangeEventType.Remove)
            {
                m_Grid.InvalidateRange(e.Range);
            }
            else             //clear
            {
                m_Grid.InvalidateCells();
            }

            if (SelectionChange != null)
            {
                SelectionChange(this, e);
            }
        }
Пример #2
0
        /// <summary>
        /// Invalidate all the selected cells
        /// </summary>
        public virtual void Invalidate()
        {
            RangeCollection ranges = GetRanges();

            for (int i = 0; i < ranges.Count; i++)
            {
                m_Grid.InvalidateRange(ranges[i]);
            }
        }