Is there a way to subscribe to the Cut event on a XamGrid. I have tried hooking to:
In XAML:
ClipboardCopying="OnClipboardCopying"
In .cs:
private void OnClipboardCopying(object sender, ClipboardCopyingEventArgs e)
{// Get selected cellsList<CellBase> selectedCells = new List<CellBase>(e.SelectedItems);
// Clear the style of the previously selected cellsif (_previouslySelectedCells != null && _previouslySelectedCells.Count > 0){SetCellStyle(_previouslySelectedCells, null);}
// Check if the selected region of cells is valid for pastingbool IsValidSelectedRec = e.ValidateSelectedRectangle();
if (IsValidSelectedRec){// Color in blue the valid cell selectionSystem.Windows.Style CellStyleResource = this.Resources["CutRowStyle"] as System.Windows.Style;this.SetCellStyle(selectedCells, CellStyleResource);}else{// Cancel the copying event if the selected region of cells is not rectangular e.Cancel = true;}
_previouslySelectedCells = selectedCells;}
but the OnClipboardCopying function is just being called on a Copy and not a Cut operation. Is there any other way to get around it?
Thanks!
Hello Erika B
Thank you for contact Infragistics support.
Regarding your inquiry, the XamGrid only support copy and paste for clipboard operation.
Please check our online help page below.
Copy-Paste support:
http://ko.infragistics.com/help/wpf/xamgrid-copy-paste-support
Let me know if you have any further question.
Best Regards.
Hyung
Infragistics Developer Support
Thanks for your reply but I am looking for the 'Cut' support. I've already have the 'Copy-Paste' working. Would you know which event I should hook up to? OnClipboardCopying is just being triggered when doing a Copy (Ctrl+C) but not a Cut (Ctrl+X)