Class GridModelCutPaste
Implements the methods to manage cut, copy, and paste for a grid.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridModelCutPaste : GridModelBound, IDisposable
Remarks
Constructors
GridModelCutPaste(GridModel)
Initializes a new instances of GridModelCutPaste and associates it with a GridModel.
Declaration
public GridModelCutPaste(GridModel model)
Parameters
Type | Name | Description |
---|---|---|
GridModel | model | A reference to the parent GridModel |
Properties
ClipboardFlags
Gets or sets various GridDragDropFlags options that specify how clipboard cut, copy, and paste should be handled.
Declaration
public int ClipboardFlags { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
You can specify here if you only want top copy or paste text and if row or column header text should be included.
Methods
CanCopy()
Determines whether if there are selected ranges that can be copied to clipboard or if the current cell's contents can be copied.
Declaration
public bool CanCopy()
Returns
Type | Description |
---|---|
System.Boolean | True if there is information available to be copied to clipboard. |
Remarks
Call this method for example to enable or gray out menu commands like "Copy Cells".
CanCut()
Determines whether if there are selected ranges that can be cut and copied to clipboard or if the current cell's contents can be cut and copied.
Declaration
public bool CanCut()
Returns
Type | Description |
---|---|
System.Boolean | True if there is information available to be cut and copied to clipboard. |
Remarks
Call this method for example to enable or gray out menu commands like "Cut Cells".
CanPaste()
Determines whether if there is information on the clipboard that can be pasted into the grid.
Declaration
public bool CanPaste()
Returns
Type | Description |
---|---|
System.Boolean | True if there is information available to be pasted into the grid. |
Remarks
Call this method for example to enable or gray out menu commands like "Paste Cells".
Copy()
Determines whether copies the contents of cells in selected to clipboard and the current cell's contents.
Declaration
public bool Copy()
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Remarks
If there are no selected ranges, the current cell's Copy() method is called. Otherwise, selected ranges will be copied.
See the ClipboardFlags property how to customize the default behavior.
CopyCellsToClipboard(GridRangeInfoList, Boolean)
Determines whether copies the style information of a specified range of cells to clipboard.
Declaration
public bool CopyCellsToClipboard(GridRangeInfoList rangeList, bool bLoadBaseStyles)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | The range list with cells to be copied. |
System.Boolean | bLoadBaseStyles | True if information from base styles should also be copied; False if only the settings that were initialized for the cells should be copied. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
CopyRange(GridRangeInfo)
Determines whether copies the contents of a specified range of cells to clipboard.
Declaration
public bool CopyRange(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range with cells to be copied. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Remarks
See the ClipboardFlags property how to customize the default behavior.
CopyRange(GridRangeInfoList)
Copies the contents of a specified range of cells to clipboard.
Declaration
public bool CopyRange(GridRangeInfoList rangeList)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | The range list with cells to be copied. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
CopyTextToClipboard(GridRangeInfoList)
Determines whether copies the formatted text of a specified range of cells to clipboard.
Declaration
public bool CopyTextToClipboard(GridRangeInfoList rangeList)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | The range list with cells to be copied. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Cut()
Determines whether cuts and copies the contents of cells in selected to clipboard and the current cell's contents.
Declaration
public bool Cut()
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Remarks
If there are no selected ranges, the current cell's Cut() method is called. Otherwise, selected ranges will be copied.
See the ClipboardFlags property how to customize the default behavior.
CutRange(GridRangeInfo, Boolean)
Cuts and copies the contents of a specified range of cells to clipboard.
Declaration
public bool CutRange(GridRangeInfo range, bool clearStyle)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range with cells to be cut and copied. |
System.Boolean | clearStyle | True if you want to clear all cell information; False if you only want to clear text. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Remarks
See the ClipboardFlags property how to customize the default behavior.
CutRange(GridRangeInfoList, Boolean)
Determines whether cuts and copies the contents of a specified range of cells to clipboard.
Declaration
public bool CutRange(GridRangeInfoList rangeList, bool clearStyle)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | The range list with cells to be copied. |
System.Boolean | clearStyle | True if you want to clear all cell information; False if you only want to clear text. |
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and copied to clipboard. |
Paste()
Determines whether paste information from the clipboard into the grid at the current selected range or current cell.
Declaration
public bool Paste()
Returns
Type | Description |
---|---|
System.Boolean | True if information was available and pasted from the clipboard. |
Remarks
If there are no selected ranges, the contents are pasted starting at the current cell's position. Otherwise, contents will be pasted into the current selected range.
See the ClipboardFlags property how to customize the default behavior.