WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridModelCoveredRanges - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridModelCoveredRanges

    Implements the functionalities to manage covered cell ranges for a grid.

    Inheritance
    System.Object
    NonFinalizeDisposable
    GridModelBound
    GridModelCoveredRanges
    Implements
    System.IDisposable
    System.Collections.ICollection
    System.Runtime.Serialization.ISerializable
    System.Collections.IEnumerable
    Inherited Members
    GridModelBound.Dispose(Boolean)
    GridModelBound.OnModelDeserialization(Object, GridModel)
    GridModelBound.SetModelInt(GridModel)
    GridModelBound.Model
    NonFinalizeDisposable.Dispose()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public sealed class GridModelCoveredRanges : GridModelBound, IDisposable, ICollection, ISerializable, IEnumerable
    Remarks

    You access this class from a grid with the CoveredRanges property of a GridModel instance.

    Covered ranges are saved in two separate collections.

    The first collection is GridRangeInfoList that allows quick enumeration through all covered cell ranges in the grid. This is good when covered ranges need to be recalculated because rows or column have been inserted, moved, or removed.

    The second collection is GridCoveredCellPool that is optimized to look up if a specific cell is part of a covered range.

    The QueryCoveredRange event in a GridModel lets you also provide customized covered cell ranges at run-time. For example, you might want to have a pattern of covered ranges. This allows you to customize the grid's default behavior and manage covered ranges by your own code and not with the GridModelCoveredRanges class.

    Constructors

    GridModelCoveredRanges(GridModel)

    Initializes a new instances ofGridModelCoveredRanges class and associates it with a GridModel.

    Declaration
    public GridModelCoveredRanges(GridModel model)
    Parameters
    Type Name Description
    GridModel model

    A reference to the parent GridModel.

    Properties

    Count

    Gets the number of ranges in the GridModelCoveredRanges.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    IsSynchronized

    Gets a value indicating whether is synchronized. Returns False.

    Declaration
    public bool IsSynchronized { get; }
    Property Value
    Type Description
    System.Boolean

    Ranges

    Gets the GridRangeInfoList and lets you enumerate through all covered ranges managed by this GridModelCoveredRanges instance.

    Declaration
    public GridRangeInfoList Ranges { get; }
    Property Value
    Type Description
    GridRangeInfoList

    SyncRoot

    Gets NULL.

    Declaration
    public object SyncRoot { get; }
    Property Value
    Type Description
    System.Object

    Methods

    Add(GridRangeInfo)

    Adds a covered range cell.

    Declaration
    public void Add(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range

    A range to add.

    AddRange(GridRangeInfo[])

    Adds multiple covered cell ranges.

    Declaration
    public void AddRange(GridRangeInfo[] ranges)
    Parameters
    Type Name Description
    GridRangeInfo[] ranges

    The list of ranges to add

    Clear()

    Resets all covered ranges.

    Declaration
    public void Clear()

    CopyTo(Array, Int32)

    Copies all range objects into an array of GridRangeInfo starting at specified index.

    Declaration
    public void CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array

    The array of GridRangeInfo where the values should be copied to.

    System.Int32 index

    The starting index in the destination array.

    Find(Int32, Int32, out GridRangeInfo)

    Determines a GridRangeInfo object that indicates the covered range for the specified cell position or False if there is no covered range for the given cell position.

    Declaration
    public bool Find(int rowIndex, int colIndex, out GridRangeInfo range)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridRangeInfo range

    The GridRangeInfo where the found covered range is returned.

    Returns
    Type Description
    System.Boolean

    True if a covered range is at the specified cell position; False if not.

    FindRange(Int32, Int32)

    Returns a GridRangeInfo object that indicates the covered range for the specified cell position or Empty if there is no covered range for the given cell position.

    Declaration
    public GridRangeInfo FindRange(int rowIndex, int colIndex)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    Returns
    Type Description
    GridRangeInfo

    A reference to the covered range is at the specified cell position or Empty if not.

    GetEnumerator()

    Returns an enumerator for stepping through all covered ranges.

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    The enumerator for the Ranges collection.

    InsertCols(Int32, Int32)

    Synchronizes the covered ranges after columns have been inserted in the grid.

    Declaration
    public void InsertCols(int insertAt, int count)
    Parameters
    Type Name Description
    System.Int32 insertAt

    The starting columns index where new columns should be inserted.

    System.Int32 count

    The number of rows to insert.

    InsertRows(Int32, Int32)

    Synchronizes the covered ranges after rows have been inserted in the grid.

    Declaration
    public void InsertRows(int insertAt, int count)
    Parameters
    Type Name Description
    System.Int32 insertAt

    The starting row index where new rows should be inserted.

    System.Int32 count

    The number of rows to insert.

    Merge(GridRangeInfo)

    Combines all covered ranges that intersect into one outer range that spans over all found ranges.

    Declaration
    public GridRangeInfo Merge(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range

    The original range.

    Returns
    Type Description
    GridRangeInfo

    The GridRangeInfo with the outer range.

    MoveCols(Int32, Int32, Int32, Int32)

    Synchronizes the covered ranges after columns have been moved within the grid.

    Declaration
    public void MoveCols(int from, int last, int target, int colCount)
    Parameters
    Type Name Description
    System.Int32 from

    The first column index.

    System.Int32 last

    The last column index.

    System.Int32 target

    The target row.

    System.Int32 colCount

    The current column count in the grid.

    MoveRows(Int32, Int32, Int32, Int32)

    Synchronizes the covered ranges after rows have been moved within the grid.

    Declaration
    public void MoveRows(int from, int last, int target, int rowCount)
    Parameters
    Type Name Description
    System.Int32 from

    The first row index.

    System.Int32 last

    The last row index.

    System.Int32 target

    The target row.

    System.Int32 rowCount

    The current row count in the grid.

    OnChanged(GridCoveredRangesChangedEventArgs)

    Raises the Changed event.

    Declaration
    public void OnChanged(GridCoveredRangesChangedEventArgs e)
    Parameters
    Type Name Description
    GridCoveredRangesChangedEventArgs e

    A GridRowColSizeChangedEventArgs that contains the event data.

    OnChanging(GridCoveredRangesChangingEventArgs)

    Raises the Changing event.

    Declaration
    public bool OnChanging(GridCoveredRangesChangingEventArgs e)
    Parameters
    Type Name Description
    GridCoveredRangesChangingEventArgs e

    A GridRowColSizeChangingEventArgs that contains the event data.

    Returns
    Type Description
    System.Boolean

    returns boolean value on changing event

    Remove(GridRangeInfo)

    Removes covered cells that are contained in the specified range.

    Declaration
    public void Remove(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range

    The range that you want to clear from covered cells.

    RemoveCols(Int32, Int32)

    Determines whether synchronize the covered ranges after columns have been removed from the grid.

    Declaration
    public bool RemoveCols(int fromColIndex, int toColIndex)
    Parameters
    Type Name Description
    System.Int32 fromColIndex

    The first column index.

    System.Int32 toColIndex

    The last column index.

    Returns
    Type Description
    System.Boolean

    True if any covered ranges were affected; False if no range needed to be changed.

    RemoveRows(Int32, Int32)

    Determines whether synchronize the covered ranges after rows have been removed from the grid.

    Declaration
    public bool RemoveRows(int fromRowIndex, int toRowIndex)
    Parameters
    Type Name Description
    System.Int32 fromRowIndex

    The first row index.

    System.Int32 toRowIndex

    The last row index.

    Returns
    Type Description
    System.Boolean

    True if any covered ranges were affected; False if no range needed to be changed.

    SetCoveredRange(GridRangeInfo, Boolean)

    Adds or removes a covered range.

    Declaration
    public void SetCoveredRange(GridRangeInfo range, bool setOrReset)
    Parameters
    Type Name Description
    GridRangeInfo range

    The affected range that indicates a new covered cell or the range of cells where covered cells should be removed.

    System.Boolean setOrReset

    True if you want to add a covered; False if range should be cleared.

    SetCoveredRanges(GridRangeInfoList, Boolean)

    Adds or removes one or multiple covered ranges.

    Declaration
    public void SetCoveredRanges(GridRangeInfoList ranges, bool setOrReset)
    Parameters
    Type Name Description
    GridRangeInfoList ranges

    The list that holds range with new covered cells or ranges where covered cells should be removed.

    System.Boolean setOrReset

    True if you want to add covered cells; False if ranges should be cleared.

    UpdateList()

    Synchronizes the GridCoveredCellPool. The pool will be emptied and initialized with ranges specified in the Ranges collection.

    Declaration
    public void UpdateList()

    Explicit Interface Implementations

    ISerializable.GetObjectData(SerializationInfo, StreamingContext)

    Implements the ISerializable interface and returns the data needed to serialize the GridModelCoveredRanges.

    Declaration
    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A SerializationInfo object containing the information required to serialize the object.

    System.Runtime.Serialization.StreamingContext context

    A StreamingContext object containing the source and destination of the serialized stream.

    Implements

    System.IDisposable
    System.Collections.ICollection
    System.Runtime.Serialization.ISerializable
    System.Collections.IEnumerable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved