Hi,
I set FieldSettings.AllowEdit to false and would like to copy(Ctrl+C) the cell of grid.
But it seems I can't select the text of the cell.
Is current version provide this functionality?
Thanks
Hello,
In 9.2 version, you can use the clipboard support and copy the content of the selected cells with Ctrl + C.
You have to turn on this feature first
XamDataGrid.FieldLayoutSettings.AllowClipboardOperations = AllowClipboardOperations.Copy;
and then select the cells that you want to copy and press Ctrl + C.
hello,
it works. but the value is the string of class type. in my application, the CellValuePresenter.Value is a class instance and i set up binding so that the cell can show the correct value.
it seems the Ctrl+C copy the CellValuePresenter.Value.ToString(). is there any way to customize the string copy to clipboard without change the ToString method of CellValuePresenter.Value ?
the event args expose e.Values collection. From there, you can modify the values of the cells that you are copying.
if i want to change the text copy to clipboard, what property of ClipboardCopyingEventArgs i need to set?
Yes, i have a custom template for the CellValuePresenter, so CellValuePresenter.Value is not same as
the text displayed in the grid.
i will have a try to use the ClipboardCopying event
I am not sure I follow. You should be copying what you are seeing in the cell. However, I think you can use the ClipboardCopying event where you can modify what you are copying.
[Edit] Do you have a custom template for the CellValuePresenter?