DataGridColumn.OnPastingCellClipboardContent(Object, Object) 方法

定義

引發 PastingCellClipboardContent 事件。Raises the PastingCellClipboardContent event.

public:
 virtual void OnPastingCellClipboardContent(System::Object ^ item, System::Object ^ cellContent);
public virtual void OnPastingCellClipboardContent (object item, object cellContent);
abstract member OnPastingCellClipboardContent : obj * obj -> unit
override this.OnPastingCellClipboardContent : obj * obj -> unit
Public Overridable Sub OnPastingCellClipboardContent (item As Object, cellContent As Object)

參數

item
Object

所選取項目的資料內容。The data context for the selected element.

cellContent
Object

要貼至儲存格中的內容。The content to paste into the cell.

備註

如果您提供的DataGrid自訂貼上執行,則可以使用這個方法做為 helper。This method can be used as a helper if you provide a custom paste implementation for the DataGrid. 資料格內容會儲存在item物件中。The cell content is stored in the item object.

這個方法會引發PastingCellClipboardContent事件。This method raises the PastingCellClipboardContent event. 您可以處理事件,以在將資料格貼到儲存格之前,修改其內容。You can handle the event to modify the cell content before it is pasted into the cell. 您可以將cellContent設定null為,以取消貼上動作。You can set cellContent to null to cancel the paste action.

適用於

另請參閱