Class GridRangeInfoList
A collection of GridRangeInfo objects.
Inheritance
Implements
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridRangeInfoList : CollectionBase, ICloneable, IFormattable, ISerializable
Constructors
GridRangeInfoList()
Initializes a new empty GridRangeInfoList.
Declaration
public GridRangeInfoList()
GridRangeInfoList(SerializationInfo, StreamingContext)
Initializes a new GridRangeInfoList from a serialization stream.
Declaration
protected GridRangeInfoList(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or deserialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
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 |
Item[Int32]
The GridRangeInfo at a specific index.
Declaration
public GridRangeInfo this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
GridRangeInfo |
Methods
Add(GridRangeInfo)
Adds GridRangeInfo to the end of the GridRangeInfoList.
Declaration
public int Add(GridRangeInfo value)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | value | The GridRangeInfo to be added to the list. |
Returns
Type | Description |
---|---|
System.Int32 | The index of the new element. |
AddRange(GridRangeInfo[])
Adds GridRangeInfo elements from an array to the range list.
Declaration
public void AddRange(GridRangeInfo[] value)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo[] | value | An array of GridRangeInfo objects. |
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. |
Contains(GridRangeInfo)
Checks if the range list contains a range object that equals the specified range.
Declaration
public bool Contains(GridRangeInfo value)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | value | The range to be searched for. |
Returns
Type | Description |
---|---|
System.Boolean | True if range was found; False if not found. |
CopyTo(GridRangeInfo[], Int32)
Copies all range objects into an array of GridRangeInfo starting at specified index.
Declaration
public void CopyTo(GridRangeInfo[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo[] | array | The array of GridRangeInfo where the values should be copied to. |
System.Int32 | index | The starting index in the destination array. |
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. |
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. |
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).
GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridRangeInfoList.
Declaration
public virtual void 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. |
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).
IndexOf(GridRangeInfo)
Returns the position of a specific range in the list that equals a specifed range.
Declaration
public int IndexOf(GridRangeInfo value)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | value | The range to be searched for. |
Returns
Type | Description |
---|---|
System.Int32 | The position of the range; - 1 if not found. |
Insert(Int32, GridRangeInfo)
Inserts a GridRangeInfo at a specified position.
Declaration
public void Insert(int index, GridRangeInfo value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index where the value should be inserted. |
GridRangeInfo | value | The value to be inserted. |
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().
Remove(GridRangeInfo)
Removes a specific range from the range list.
Declaration
public void Remove(GridRangeInfo value)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | value | The range to be removed. |
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. |
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. |