Class GridModelBanneredRanges
Implements the functionalities to manage bannered cell ranges for a grid.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public sealed class GridModelBanneredRanges : GridModelBound, IDisposable, ICollection, ISerializable, IEnumerable
Remarks
You access this class from a grid with the BanneredRanges property of a GridModel instance.
Bannered ranges are saved in two separate collections.
The first collection is GridRangeInfoList, which allows quick enumeration through all bannered cell ranges in the grid. This is good when bannered ranges need to be recalculated because rows or column have been inserted, moved, or removed.
The second collection is GridBanneredCellPool, which is optimized to look up if a specific cell is part of a bannered range.
The QueryBanneredRange event in a GridModel lets you provide customized bannered cells ranges at run-time. For example you might want to have a pattern of bannered ranges. This allows you to customize the grid's default behavior and manage bannered ranges by your own code and not with the GridModelBanneredRanges class.
Constructors
GridModelBanneredRanges(GridModel)
Initializes a new instances of GridModelBanneredRanges class and associates it with a GridModel.
Declaration
public GridModelBanneredRanges(GridModel model)
Parameters
Type | Name | Description |
---|---|---|
GridModel | model | A reference to the parent GridModel |
Properties
Count
Gets the number of ranges in the GridModelBanneredRanges.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsSynchronized
Gets a value indicating whether IsSynchronized. Returns False.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Ranges
Gets the GridRangeInfoList and lets you enumerate through all bannered ranges managed by this GridModelBanneredRanges instance.
Declaration
public GridRangeInfoList Ranges { get; }
Property Value
Type |
---|
GridRangeInfoList |
SyncRoot
Gets NULL.
Declaration
public object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Methods
Add(GridRangeInfo)
Adds a bannered range cell.
Declaration
public void Add(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | Cell range. |
AddRange(GridRangeInfo[])
Adds multiple bannered range cells.
Declaration
public void AddRange(GridRangeInfo[] ranges)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo[] | ranges | The list of ranges to add |
Clear()
Resets all bannered 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 bannered range for the specified cell position or False if there is no bannered 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 bannered range is returned. |
Returns
Type | Description |
---|---|
System.Boolean | True if a bannered range is at the specified cell position; False if not. |
FindRange(Int32, Int32)
Returns a GridRangeInfo object that indicates the bannered range for the specified cell position or Empty if there is no bannered 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 bannered range is at the specified cell position or Empty if not. |
GetEnumerator()
Returns an enumerator for stepping through all bannered ranges.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator for the Ranges collection. |
InsertCols(Int32, Int32)
Synchronizes the bannered 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 column's index where new columns should be inserted. |
System.Int32 | count | The number of rows to insert. |
InsertRows(Int32, Int32)
Synchronizes the bannered 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 bannered 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 bannered 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 bannered 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(GridBanneredRangesChangedEventArgs)
Raises the Changed event.
Declaration
public void OnChanged(GridBanneredRangesChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridBanneredRangesChangedEventArgs | e | A GridRowColSizeChangedEventArgs that contains the event data. |
OnChanging(GridBanneredRangesChangingEventArgs)
Raises the Changing event.
Declaration
public bool OnChanging(GridBanneredRangesChangingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridBanneredRangesChangingEventArgs | e | A GridRowColSizeChangingEventArgs that contains the event data. |
Returns
Type | Description |
---|---|
System.Boolean | return boolean value to indicate changing |
Remove(GridRangeInfo)
Removes bannered 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 bannered cells. |
RemoveCols(Int32, Int32)
Determines whether synchronize the bannered 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 bannered ranges were affected; False if no range needed to be changed. |
RemoveRows(Int32, Int32)
Determines whether synchronize the bannered 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 bannered ranges were affected; False if no range needed to be changed. |
SetBanneredRange(GridRangeInfo, Boolean)
Adds or removes a bannered range.
Declaration
public void SetBanneredRange(GridRangeInfo range, bool setOrReset)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The affected range that indicates a new bannered cell or the range of cells where bannered cells should be removed. |
System.Boolean | setOrReset | True if you want to add a bannered; False if range should be cleared. |
SetBanneredRanges(GridRangeInfoList, Boolean)
Adds or removes one or multiple bannered range.
Declaration
public void SetBanneredRanges(GridRangeInfoList ranges, bool setOrReset)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | ranges | The list that holds range with new bannered cells or ranges where bannered cells should be removed. |
System.Boolean | setOrReset | True if you want to add bannered cells; False if ranges should be cleared. |
UpdateList()
Synchronizes the GridBanneredCellPool. 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 GridModelBanneredRanges.
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. |