Class GridModelRowColOperations
Implements methods for row and column operations in the grid. Allows you to insert, move, remove rows, and more.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public abstract class GridModelRowColOperations : GridModelBound, IDisposable, ISerializable
Remarks
See Syncfusion.Windows.Forms.Grid.GridModelRowOperations for row operations and Syncfusion.Windows.Forms.Grid.GridModelColOperations for column operations.
You typically do not derive or instantiate this class. The GridModel class instantiates objects of this class. You can access all members of this class through the Rows and Cols objects.
Constructors
GridModelRowColOperations(GridModel)
Initializes a new instances of GridModelRowColOperations and associates it with a GridModel.
Declaration
protected GridModelRowColOperations(GridModel model)
Parameters
Type | Name | Description |
---|---|---|
GridModel | model | A reference to the parent GridModel. |
GridModelRowColOperations(SerializationInfo, StreamingContext)
Initializes a new instance of GridModelRowColOperations from a serialization stream.
Declaration
protected GridModelRowColOperations(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or de-serialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
CanFreezeSelection
Gets a value indicating whether the grid has a current selected range that can be frozen.
Declaration
public bool CanFreezeSelection { get; }
Property Value
Type |
---|
System.Boolean |
CanRestoreFrozen
Gets a value indicating whether there is a frozen range of rows (or columns) that can be unfrozen.
Declaration
public bool CanRestoreFrozen { get; }
Property Value
Type |
---|
System.Boolean |
DefaultSize
Gets or sets the default row height (or column width).
Declaration
public int DefaultSize { get; set; }
Property Value
Type |
---|
System.Int32 |
FrozenCount
Gets or sets the number of frozen rows (or columns).
Declaration
public int FrozenCount { get; set; }
Property Value
Type |
---|
System.Int32 |
HeaderCount
Gets or sets the number of row (or column) headers.
Declaration
public int HeaderCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Hidden
Declaration
public abstract GridModelHideRowColsIndexer Hidden { get; }
Property Value
Type |
---|
GridModelHideRowColsIndexer |
MaxSize
Gets or sets the maximum row height (or column width).
Declaration
public int MaxSize { get; set; }
Property Value
Type |
---|
System.Int32 |
RowColName
Gets "Row" or "Col" string.
Declaration
public abstract string RowColName { get; }
Property Value
Type |
---|
System.String |
Size
Gets a reference to RowHeights or ColWidths.
Declaration
public abstract GridModelRowColSizeIndexer Size { get; }
Property Value
Type |
---|
GridModelRowColSizeIndexer |
Methods
CreateRangeFromTo(Int32, Int32)
Used internally.
Declaration
public abstract GridRangeInfo CreateRangeFromTo(int from, int last)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | |
System.Int32 | last |
Returns
Type | Description |
---|---|
GridRangeInfo | returns GridRangeInfo |
DataInsertRange(Int32, Int32)
Used internally.
Declaration
protected abstract void DataInsertRange(int insertAt, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | |
System.Int32 | count |
DataMoveRange(Int32, Int32, Int32)
Used internally.
Declaration
protected abstract void DataMoveRange(int from, int count, int target)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | |
System.Int32 | count | |
System.Int32 | target |
DataRemoveRange(Int32, Int32)
Used internally.
Declaration
protected abstract void DataRemoveRange(int removeAt, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | removeAt | |
System.Int32 | count |
DelayFloatingCells(Int32, Int32)
Force recalculation of floating cell's state for the specified range of rows (or columns).
Declaration
public abstract void DelayFloatingCells(int from, int last)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row (or column) index. |
System.Int32 | last | The last row (or column) index. |
FreezeRange(Int32, Int32)
Freeze the specified range of rows (or columns). Moves them to the start of the grid and sets FrozenCount.
Declaration
public void FreezeRange(int from, int last)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row (or column) index. |
System.Int32 | last | The last row (or column) index. |
FreezeSelection()
Freeze the current selected range of rows (or columns). Moves them to the start of the grid and sets FrozenCount.
Declaration
public void FreezeSelection()
GetCells(Int32, Int32)
Gets a table that represents a range of row (or columns).
Declaration
public GridStyleInfoStoreTable GetCells(int from, int last)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row (or column) index. |
System.Int32 | last | The last row (or column) index. |
Returns
Type | Description |
---|---|
GridStyleInfoStoreTable | A GridStyleInfoStoreTable object that holds contents for all the cells. |
See Also
GetCells(Int32, Int32, Boolean, Boolean)
Gets a table that represents a range of row (or columns).
Declaration
public abstract GridStyleInfoStoreTable GetCells(int from, int last, bool getRowColStyle, bool copyCells)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row (or column) index. |
System.Int32 | last | The last row (or column) index. |
System.Boolean | getRowColStyle | True if row or column parent styles should be copied. |
System.Boolean | copyCells | True if cell contents should be copied. |
Returns
Type | Description |
---|---|
GridStyleInfoStoreTable | A GridStyleInfoStoreTable object that holds contents for all the cells. |
See Also
GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridModelRowColOperations.
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. |
GetRangeFromTo(GridRangeInfo, out Int32, out Int32)
Used internally.
Declaration
protected abstract void GetRangeFromTo(GridRangeInfo range, out int from, out int last)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | |
System.Int32 | from | |
System.Int32 | last |
GetSelectedRowColRanges()
Queries selected row or column ranges.
Declaration
public abstract GridRangeInfoList GetSelectedRowColRanges()
Returns
Type | Description |
---|---|
GridRangeInfoList | Returns a GridRangeInfoList with all selected rows (or columns). |
InsertRange(Int32, Int32)
Inserts a range of rows or columns at a specified index.
Declaration
public void InsertRange(int insertAt, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The index where rows or columns should be inserted. |
System.Int32 | count | The number of rows or columns to insert. |
Remarks
InsertRange(Int32, Int32) checks ShouldGenerateUndoInfo and generates undo information if necessary.
InsertRange(Int32, Int32, GridModelInsertRangeOptions)
Inserts a range of rows or columns at a specified index.
Declaration
public void InsertRange(int insertAt, int count, GridModelInsertRangeOptions iro)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The index where rows or columns should be inserted. |
System.Int32 | count | The number of rows or columns to insert. |
GridModelInsertRangeOptions | iro | Specifies cell contents, row, and columns heights, hidden state, and covered cells information. |
MoveRange(Int32, Int32)
Moves a range of rows or columns.
Declaration
public void MoveRange(int from, int target)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row or column index. |
System.Int32 | target | The destination row or column index. |
Remarks
MoveRange(Int32, Int32) checks ShouldGenerateUndoInfo and generates undo information if necessary.
MoveRange(Int32, Int32, Int32)
Moves a range of rows or columns.
Declaration
public void MoveRange(int from, int count, int target)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row or colum index. |
System.Int32 | count | The number of rows or columns to move. |
System.Int32 | target | The destination row or column index. |
OnDefaultSizeChanged(GridDefaultSizeChangedEventArgs)
Raises the OnDefaultRowHeightChanged(GridDefaultSizeChangedEventArgs) or OnDefaultColWidthChanged(GridDefaultSizeChangedEventArgs) event in the GridModel object.
Declaration
public abstract void OnDefaultSizeChanged(GridDefaultSizeChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridDefaultSizeChangedEventArgs | e | Event data |
OnDefaultSizeChanging(GridDefaultSizeChangingEventArgs)
Raises the DefaultRowHeightChanging or OnDefaultColWidthChanging(GridDefaultSizeChangingEventArgs) event in the GridModel object.
Declaration
public abstract bool OnDefaultSizeChanging(GridDefaultSizeChangingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridDefaultSizeChangingEventArgs | e | Event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if operation can proceed; False if it should abort. |
OnFrozenCountChanged(GridCountChangedEventArgs)
Used internally.
Declaration
protected abstract void OnFrozenCountChanged(GridCountChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridCountChangedEventArgs | e |
OnFrozenCountChanging(GridCountChangingEventArgs)
Used internally.
Declaration
protected abstract bool OnFrozenCountChanging(GridCountChangingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridCountChangingEventArgs | e |
Returns
Type | Description |
---|---|
System.Boolean | returns boolean value |
OnHeaderCountChanged(GridCountChangedEventArgs)
Used internally.
Declaration
protected abstract void OnHeaderCountChanged(GridCountChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridCountChangedEventArgs | e |
OnHeaderCountChanging(GridCountChangingEventArgs)
Used internally.
Declaration
protected abstract bool OnHeaderCountChanging(GridCountChangingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridCountChangingEventArgs | e |
Returns
Type | Description |
---|---|
System.Boolean | returns boolean value |
OnRangeInserted(GridRangeInsertedEventArgs)
Raises the OnColsInserted(GridRangeInsertedEventArgs) or OnRowsInserted(GridRangeInsertedEventArgs) event in the GridModel object.
Declaration
public abstract void OnRangeInserted(GridRangeInsertedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInsertedEventArgs | e | Event data. |
OnRangeInserting(GridRangeInsertingEventArgs)
Raises the OnColsInserting(GridRangeInsertingEventArgs) or OnRowsInserting(GridRangeInsertingEventArgs) event in the GridModel object.
Declaration
public abstract bool OnRangeInserting(GridRangeInsertingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInsertingEventArgs | e | Event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if operation can proceed; False if it should abort. |
OnRangeMoved(GridRangeMovedEventArgs)
Raises the OnColsMoved(GridRangeMovedEventArgs) or OnRowsMoved(GridRangeMovedEventArgs) event in the GridModel object.
Declaration
public abstract void OnRangeMoved(GridRangeMovedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeMovedEventArgs | e | Event data. |
OnRangeMoving(GridRangeMovingEventArgs)
Raises the OnColsMoving(GridRangeMovingEventArgs) or OnRowsMoving(GridRangeMovingEventArgs) event in the GridModel object.
Declaration
public abstract bool OnRangeMoving(GridRangeMovingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeMovingEventArgs | e | An GridRangeMovingEventArgsthat contains the event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if operation can proceed; False if it should abort. |
OnRangeRemoved(GridRangeRemovedEventArgs)
Raises the OnColsRemoved(GridRangeRemovedEventArgs) or OnRowsRemoved(GridRangeRemovedEventArgs) event in the GridModel object.
Declaration
public abstract void OnRangeRemoved(GridRangeRemovedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeRemovedEventArgs | e | Event data. |
OnRangeRemoving(GridRangeRemovingEventArgs)
Updates internal structures before removing rows or columns.
Declaration
public abstract bool OnRangeRemoving(GridRangeRemovingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeRemovingEventArgs | e | Event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if operation can proceed; False if it should abort. |
RaiseRemoving(GridRangeRemovingEventArgs)
Raises the OnColsRemoving(GridRangeRemovingEventArgs) or OnRowsRemoving(GridRangeRemovingEventArgs) event in the GridModel object.
Declaration
protected abstract bool RaiseRemoving(GridRangeRemovingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeRemovingEventArgs | e | Event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if operation can proceed; False if it should abort. |
RemoveRange(Int32, Int32)
Removes a range of rows or columns.
Declaration
public void RemoveRange(int from, int last)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The first row or column index. |
System.Int32 | last | The last row or column index. |
Remarks
RemoveRange(Int32, Int32) checks ShouldGenerateUndoInfo and generates undo information if necessary.
RestoreFrozen()
Unfreezes a previously frozen range of rows (or columns) and moves the rows or columns back to original position.
Declaration
public void RestoreFrozen()
SetCells(Int32, GridStyleInfoStoreTable)
Changes the cell contents at a specific row or column index.
Declaration
public void SetCells(int index, GridStyleInfoStoreTable data)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The row (or column) index. |
GridStyleInfoStoreTable | data | A GridStyleInfoStoreTable object that holds contents for all the cells. |
See Also
SetCells(Int32, GridStyleInfoStoreTable, Boolean, Boolean)
Changes the cell contents at a specific row or column index.
Declaration
public abstract void SetCells(int index, GridStyleInfoStoreTable data, bool extendRows, bool extendCols)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The row (or column) index. |
GridStyleInfoStoreTable | data | A GridStyleInfoStoreTable object that holds contents for all the cells. |
System.Boolean | extendRows | True if appending rows is allowed if data holds more rows than fit into the grid. |
System.Boolean | extendCols | True if appending columns is allowed if data holds more columns than fit into the grid. |
See Also
SetFrozenCount(Int32, Boolean)
Gets or sets the number of frozen rows or columns without raising FrozenRowCountChanging, FrozenColCountChanging, FrozenRowCountChanged, and FrozenColCountChanged events.
Declaration
public void SetFrozenCount(int value, bool raiseEvents)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The new count. |
System.Boolean | raiseEvents | Specifies if FrozenRowCountChanging, FrozenColCountChanging, FrozenRowCountChanged, and FrozenColCountChanged events should be raised. |
SetHeaderCount(Int32, Boolean)
Gets or sets the number of header rows or columns without raising HeaderRowCountChanging, HeaderColCountChanging, HeaderRowCountChanged, and HeaderColCountChanged events.
Declaration
public void SetHeaderCount(int value, bool raiseEvents)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The new count. |
System.Boolean | raiseEvents | Specifies if HeaderRowCountChanging, HeaderColCountChanging, HeaderRowCountChanged, and HeaderColCountChanged events should be raised. |