Class GridCutCopyPaste
Represents the clipboard operations in SfDataGrid.
Inheritance
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class GridCutCopyPaste : Object, IGridCopyPaste, IDisposable
Constructors
GridCutCopyPaste(SfDataGrid)
Initializes a new instance of the GridCutCopyPaste class.
Declaration
public GridCutCopyPaste(SfDataGrid dataGrid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | dataGrid | The instance of SfDataGrid. |
Fields
dataGrid
Gets or sets an instance of SfDataGrid .
Declaration
protected SfDataGrid dataGrid
Field Value
Type |
---|
SfDataGrid |
leftMostColumnIndex
Gets or sets the left most selected column index of the grid while copying with cell selection.
Declaration
protected int leftMostColumnIndex
Field Value
Type |
---|
System.Int32 |
rightMostColumnIndex
Gets or sets the right most selected column index of the grid while copying with cell selection.
Declaration
protected int rightMostColumnIndex
Field Value
Type |
---|
System.Int32 |
Methods
CanConvertToType(Object, ref Type)
Determines whether the copied cell value type is compatible with type of paste cell content.
Declaration
protected bool CanConvertToType(object value, ref Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The corresponding value can be compatible with paste cell type. |
System.Type | type | Contains type of selected column. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the copied value type is compatible with paste cell value type; otherwise, false. |
ClearCellsByCut(ObservableCollection<Object>)
Invoked when the cut operation performed on rows or cells in SfDataGrid.
Declaration
protected virtual void ClearCellsByCut(ObservableCollection<object> selections)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ObservableCollection<System.Object> | selections | Contains the collection of selected records or cells based on the selection unit. |
CommitValue(Object, GridColumn, IPropertyAccessProvider, Object)
Commits the value for the specified row data, column and corresponding changed value.
Declaration
protected virtual void CommitValue(object rowData, GridColumn column, IPropertyAccessProvider provider, object changedValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | The corresponding row data to commit value. |
GridColumn | column | The corresponding column to commit value. |
IPropertyAccessProvider | provider | The corresponding provider to commit value. |
System.Object | changedValue | The corresponding changed value to commit. |
Copy()
Copies the selected rows or cells from SfDataGrid to clipboard.
Declaration
public void Copy()
Remarks
This method is invoked when the Ctrl+C key is pressed.
CopyCell(Object, GridColumn, ref StringBuilder)
Copies the particular cell value for the specified column and record.
Declaration
protected virtual void CopyCell(object record, GridColumn column, ref StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to copy the cell. |
GridColumn | column | The corresponding column to copy the cell. |
System.Text.StringBuilder | text | The corresponding copied value is append to the reference parameter. |
CopyCellRow(List<GridCellInfo>, ref StringBuilder)
Invoked when the copy operation is performed for the particular selected cell.
Declaration
protected virtual void CopyCellRow(List<GridCellInfo> row, ref StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GridCellInfo> | row | The corresponding row to process copy operation. |
System.Text.StringBuilder | text | The corresponding copied value is append to the reference parameter. |
CopyCells(GridSelectedCellsCollection, StringBuilder)
Invoked when the copy operation is processed for the specified collection cells.
Declaration
protected virtual void CopyCells(GridSelectedCellsCollection selectedCells, StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
GridSelectedCellsCollection | selectedCells | The collection of selected cells to perform copy operation. |
System.Text.StringBuilder | text | The corresponding copied value is append to the StringBuilder parameter. |
CopyRow(Object, ref StringBuilder)
Invoked when the copy operation is performed for the particular record.
Declaration
protected virtual void CopyRow(object record, ref StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to process copy operation. |
System.Text.StringBuilder | text | The corresponding copied value is append to the reference parameter. |
CopyRows(ObservableCollection<Object>, ref StringBuilder)
Invoked when the copy operation is processed for the specified collection records.
Declaration
protected virtual void CopyRows(ObservableCollection<object> records, ref StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ObservableCollection<System.Object> | records | The collection of record to process copy operation. |
System.Text.StringBuilder | text | The corresponding copied value is append to the reference parameter. |
CopyRowsToClipboard(Int32, Int32)
Copies the rows to clipboard for the specified start and end of the record index.
Declaration
public void CopyRowsToClipboard(int startRecordIndex, int endRecordIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startRecordIndex | The start index of the record to copy rows to clipboard. |
System.Int32 | endRecordIndex | The end index of the record to copy rows to clipboard. |
CopyTextToClipBoard(GridSelectedCellsCollection, Boolean)
Invoked when the copy operation is initiated for the collection of selected cells to clipboard for cell selection.
Declaration
protected virtual void CopyTextToClipBoard(GridSelectedCellsCollection selectedCells, bool cut)
Parameters
Type | Name | Description |
---|---|---|
GridSelectedCellsCollection | selectedCells | The collection of selected cells to initialize copy operation. |
System.Boolean | cut | Indicates whether the cut operation is performed. |
CopyTextToClipBoard(ObservableCollection<Object>, Boolean)
Invoked when the copy operation is initiated for the specified collection of records to clipboard for row selection.
Declaration
protected virtual void CopyTextToClipBoard(ObservableCollection<object> records, bool cut)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ObservableCollection<System.Object> | records | The collection of records to initialize copy operation. |
System.Boolean | cut | Indicates whether the cut operation is performed. |
Cut()
Copies the selected rows or cells and sets the default or null or empty value.
Declaration
public void Cut()
Remarks
This method is invoked when the Ctrl+X key is pressed.
CutRowCell(Object, GridColumn)
Invoked when the cut operation performed for the specified the row data and column.
Declaration
protected virtual void CutRowCell(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | Contains the row data of the selected record to perform cut operation. |
GridColumn | column | The corresponding column of the selected record to perform cut operation. |
Dispose()
Releases all the resources used by the GridCutCopyPaste class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the GridCutCopyPaste class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
GetPropertyType(Object, GridColumn)
Gets the corresponding property type for the specified row data and column.
Declaration
protected virtual Type GetPropertyType(object rowData, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | rowData | The corresponding row data to get property type. |
GridColumn | column | The corresponding column to get property type. |
Returns
Type | Description |
---|---|
System.Type | Returns the corresponding property type. |
Paste()
Pastes the clipboard copied content to the selected rows or cells in SfDataGrid.
Declaration
public void Paste()
Remarks
This method is invoked when the Ctrl+V key is pressed.
PasteTextToCell()
Invoked when the clipboard content is splitted into number of cells to perform paste operation for cell selection.
Declaration
protected virtual void PasteTextToCell()
PasteTextToRow()
Invoked when the clipboard content is splitted into number of rows to perform paste operation for row selection.
Declaration
protected virtual void PasteTextToRow()
PasteToCell(Object, GridColumn, Object)
Pastes the copied cell value to selected cell.
Declaration
protected virtual void PasteToCell(object record, GridColumn column, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | Contains the record of the selected cell. |
GridColumn | column | Contains the corresponding column of the selected cell. |
System.Object | value | Contains copied cell value to paste. |
PasteToCells(Object)
Invoked when the paste operation is performed to each cell of the clipboard copied cells to selected cells in SfDataGrid.
Declaration
protected virtual void PasteToCells(object clipboardrows)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clipboardrows | Contains the copied clipboard content to paste cells. |
PasteToRow(Object, Object)
Invoked when the copied row is splitted into cells to perform paste operation for the specified clipboard content and selected records.
Declaration
protected virtual void PasteToRow(object clipboardcontent, object selectedRecords)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clipboardcontent | Contains the copied record to paste row. |
System.Object | selectedRecords | Contains the selected record to paste row. |
PasteToRows(Object)
Invoked when the paste operation is performed to each row of the clipboard copied rows to SfDataGrid.
Declaration
protected virtual void PasteToRows(object clipboardrows)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clipboardrows | Contains the copied clipboard content to paste rows. |
RaiseCopyContentEvent(GridCopyPasteEventArgs)
Raises the GridCopyContent event in SfDataGrid.
Declaration
protected virtual GridCopyPasteEventArgs RaiseCopyContentEvent(GridCopyPasteEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridCopyPasteEventArgs | args | Contains the event data. |
Returns
Type | Description |
---|---|
GridCopyPasteEventArgs | Returns the GridCopyPasteEventArgs. |
RaiseCopyGridCellContentEvent(GridColumn, Object, Object)
Raises the CopyGridCellContent event in SfDataGrid.
Declaration
protected virtual GridCopyPasteCellEventArgs RaiseCopyGridCellContentEvent(GridColumn column, object rowData, object clipboardValue)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column of the cell content. |
System.Object | rowData | The corresponding row data of the cell content. |
System.Object | clipboardValue | The corresponding clipboard value that is going to be copied. |
Returns
Type | Description |
---|---|
GridCopyPasteCellEventArgs | Returns the GridCopyPasteCellEventArgs. |
RaisePasteContentEvent(GridCopyPasteEventArgs)
Raises the GridPasteContent event in SfDataGrid.
Declaration
protected virtual GridCopyPasteEventArgs RaisePasteContentEvent(GridCopyPasteEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridCopyPasteEventArgs | args | Contains the event data. |
Returns
Type | Description |
---|---|
GridCopyPasteEventArgs | Returns the GridCopyPasteEventArgs. |
RaisePasteGridCellContentEvent(GridColumn, Object, Object)
Raises the PasteGridCellContent event in SfDataGrid.
Declaration
protected virtual GridCopyPasteCellEventArgs RaisePasteGridCellContentEvent(GridColumn column, object rowData, object clipboardValue)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column of the cell content. |
System.Object | rowData | The corresponding row data of the cell content. |
System.Object | clipboardValue | The corresponding clipboard value that is going to be pasted. |
Returns
Type | Description |
---|---|
GridCopyPasteCellEventArgs | Returns the GridCopyPasteCellEventArgs. |