Class GridRangeInfoList
A collection of GridRangeInfo objects.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.CellGrid
Assembly: Syncfusion.Spreadsheet.Windows.dll
Syntax
public class GridRangeInfoList : List<GridRangeInfo>, IList<GridRangeInfo>, ICollection<GridRangeInfo>, IList, ICollection, IReadOnlyList<GridRangeInfo>, IReadOnlyCollection<GridRangeInfo>, IEnumerable<GridRangeInfo>, IEnumerable, ICloneable, IFormattable
Constructors
GridRangeInfoList()
Initializes a new empty GridRangeInfoList.
Declaration
public GridRangeInfoList()
Fields
Empty
An empty and Read-only list.
Declaration
public static readonly GridRangeInfoList Empty
Field Value
Type |
---|
GridRangeInfoList |
Properties
ActiveRange
The last range in the range list.
Declaration
public GridRangeInfo ActiveRange { get; }
Property Value
Type |
---|
GridRangeInfo |
Info
Results of ToString method.
Declaration
public string Info { get; }
Property Value
Type |
---|
System.String |
Methods
AnyRangeContains(GridRangeInfo)
Determines if a range in the range list contains the specified range.
Declaration
public bool AnyRangeContains(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
System.Boolean | True if any range contains the specified range. |
AnyRangeIntersects(GridRangeInfo)
Determines if a range in the range list intersects with the specified range.
Declaration
public bool AnyRangeIntersects(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
System.Boolean | True if any range contains the specified range. |
Clone()
Makes an exact copy of the current object.
Declaration
public GridRangeInfoList Clone()
Returns
Type | Description |
---|---|
GridRangeInfoList | A GridRangeInfoList with duplicated GridRangeInfo objects. |
CopyTo(GridRangeInfoList, Int32)
Copies all range objects into a GridRangeInfoList starting at specified index.
Declaration
public void CopyTo(GridRangeInfoList rl, int index)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rl | The GridRangeInfoList where the values should be copied to. |
System.Int32 | index | The starting index in the destination list. |
ExpandRanges(Int32, Int32, Int32, Int32)
Creates a range list and convert column and row ranges into cell ranges with the specified bounds.
Declaration
public GridRangeInfoList ExpandRanges(int nFirstRow, int nFirstCol, int nRowCount, int nColCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nFirstRow | Row index for the first non-label cell in grid area. |
System.Int32 | nFirstCol | Column index for the first non-label cell in grid area. |
System.Int32 | nRowCount | Last row in the grid. |
System.Int32 | nColCount | Last column in the grid |
Returns
Type | Description |
---|---|
GridRangeInfoList | The GridRangeInfoList with new GridRangeInfo objects that this method creates. |
Remarks
Column ranges will be converted to cell ranges using nFirstRow and nRowCount. Row ranges will be converted to cell ranges using nFirstCol and nColCount. Column ranges will be converted to cell ranges using all input parameters.
FilterRangeType(GridRangeInfoType)
Returns a range list with ranges that match a specified GridRangeInfoType.
Declaration
public GridRangeInfoList FilterRangeType(GridRangeInfoType filter)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoType | filter | The GridRangeInfoType to search for. |
Returns
Type | Description |
---|---|
GridRangeInfoList | A GridRangeInfoList with ranges that match the above criteria. |
GetColRanges(GridRangeInfoType)
Creates a range list with column ranges that match a specified criteria.
Declaration
public GridRangeInfoList GetColRanges(GridRangeInfoType filter)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoType | filter | The filter criteria. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The range list with column ranges. |
Remarks
Use
rangeList.GetColRanges(GridRangeInfoType.Cells|GridRangeInfoType.Cols);
if you want to get column ranges for both ranges that are cells or column ranges.
Use
rangeList.GetColRanges(GridRangeInfoType.Cols);
if you only want to get column ranges and not cell ranges.
Neighboring ranges will be combined if they intersect or have the same border (e.g. C4:C5 and C6:C7 will be combined into C4:C7).
GetOuterRange(GridRangeInfo)
Returns a GridRangeInfo that spans over all ranges that intersect with a specified range.
Declaration
public GridRangeInfo GetOuterRange(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
GridRangeInfo | A GridRangeInfo that contains the original |
GetRangesContained(GridRangeInfo)
Searches for ranges in the GridRangeInfoList that are contained in a specified range.
Declaration
public GridRangeInfoList GetRangesContained(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The GridRangeInfoList with ranges that match the criteria. |
GetRangesContaining(GridRangeInfo)
Searches for ranges in the GridRangeInfoList that contain a specified range.
Declaration
public GridRangeInfoList GetRangesContaining(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The GridRangeInfoList with ranges that match the criteria. |
GetRangesIntersecting(GridRangeInfo)
Searches for ranges in the GridRangeInfoList that intersect with a specified range.
Declaration
public GridRangeInfoList GetRangesIntersecting(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be searched for. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The GridRangeInfoList with ranges that match the criteria. |
GetRowRanges(GridRangeInfoType)
Creates a range list with row ranges that match a specified criteria.
Declaration
public GridRangeInfoList GetRowRanges(GridRangeInfoType filter)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoType | filter | The filter criteria. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The range list with row ranges. |
Remarks
Use
rangeList.GetRowRanges(GridRangeInfoType.Cells|GridRangeInfoType.Rows);
if you want to get row ranges for both ranges that are cells or row ranges.
Use
rangeList.GetRowRanges(GridRangeInfoType.Rows);
if you only want to get row ranges and not cell ranges.
Neighboring ranges will be combined if they intersect or have the same border (e.g. R4:R5 and R6:R7 will be combined into R4:R7).
InsertCols(Int32, Int32)
Updates the range list when columns have been inserted in the grid.
Declaration
public void InsertCols(int col, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The column index where columns have been inserted. |
System.Int32 | count | The number of columns that were inserted. |
InsertRows(Int32, Int32)
Updates the range list when rows have been inserted in the grid.
Declaration
public void InsertRows(int row, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row index where rows have been inserted. |
System.Int32 | count | The number of rows that were inserted. |
MoveCols(Int32, Int32, Int32, Int32)
Updates the range list when columns were moved in the grid.
Declaration
public void MoveCols(int nFromCol, int nToCol, int nDestCol, int maxcol)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nFromCol | The first column index. |
System.Int32 | nToCol | The last column index. |
System.Int32 | nDestCol | The destination column index. |
System.Int32 | maxcol | The new column count in the grid. |
MoveRows(Int32, Int32, Int32, Int32)
Updates the range list when rows were moved in the grid.
Declaration
public void MoveRows(int nFromRow, int nToRow, int nDestRow, int maxrow)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nFromRow | The first row index. |
System.Int32 | nToRow | The last row index. |
System.Int32 | nDestRow | The destination row index. |
System.Int32 | maxrow | The new row count in the grid. |
Parse(String)
Creates a range list from a string with comma separated range descriptions.
Declaration
public static GridRangeInfoList Parse(string parseText)
Parameters
Type | Name | Description |
---|---|---|
System.String | parseText | The text to be parsed. |
Returns
Type | Description |
---|---|
GridRangeInfoList | The GridRangeInfoList with range objects described in the string. |
Remarks
The method parses a string that was previously created with ToString().
RemoveCols(Int32, Int32, Int32)
Updates the range list when columns were removed from the grid.
Declaration
public void RemoveCols(int from, int last, int maxcol)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first column index. |
System.Int32 | last | The last column index. |
System.Int32 | maxcol | The new column count in the grid. |
RemoveEmptyRanges()
Removes any empty ranges from the GridRangeInfoList.
Declaration
public void RemoveEmptyRanges()
RemoveRows(Int32, Int32, Int32)
Updates the range list when rows were removed from the grid.
Declaration
public void RemoveRows(int from, int last, int maxrow)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row index. |
System.Int32 | last | The last row index. |
System.Int32 | maxrow | The new row count in the grid. |
ToString()
Converts the ranges of this GridRangeInfo to a comma separated human-readable string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that contains the column and row index of the top-left and bottom-right position of this GridRangeInfo. |
Overrides
Remarks
The generate string will be in the format R#C#, R#, C#, T.
An example for a range of cells is "R1C1:R10C20" or "R5C5".
An example for a range of rows is "R1:R10" or "R6".
An example for a range of columns is "C1:C10" or "C7".
An example for a table range is "T".
Each range object will be comma separated. For example: "R3:R5,R8:R10,R14:R15".
ToString(IFormatProvider)
Converts the ranges of this GridRangeInfo to a comma separated human-readable string.
Declaration
public string ToString(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | The System.IFormatProvider to use to format the value. Is ignored. |
Returns
Type | Description |
---|---|
System.String | A string that contains the column and row index of the top-left and bottom-right position of this GridRangeInfo. |
ToString(String)
Converts the ranges of this GridRangeInfo to a comma separated human-readable string.
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | Ignored. |
Returns
Type | Description |
---|---|
System.String | A string that contains the column and row index of the top-left and bottom-right position of this GridRangeInfo. |
ToString(String, IFormatProvider)
Converts the ranges of this GridRangeInfo to a comma separated human-readable string.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | Ignored. |
System.IFormatProvider | formatProvider | The System.IFormatProvider to use to format the value. Is ignored. |
Returns
Type | Description |
---|---|
System.String | A string that contains the column and row index of the top-left and bottom-right position of this GridRangeInfo. |
Explicit Interface Implementations
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type |
---|
System.Object |