Hello,
With the copy feature in XamGrid, I'm not able to copy the selection if I select the cells via the row selector: if I hit Ctrl-C, nothing is copied to clipboard.
Here is my xaml:
<ig:XamGrid Loaded="XamGrid_Loaded" Name="grid"> <ig:XamGrid.ClipboardSettings> <ig:ClipboardSettings AllowCopy="True" CopyOptions="ExcludeHeaders" CopyType="Default" /> </ig:XamGrid.ClipboardSettings> <ig:XamGrid.SelectionSettings> <ig:SelectionSettings CellSelection="Multiple" RowSelection="Multiple" /> </ig:XamGrid.SelectionSettings> <ig:XamGrid.RowSelectorSettings> <ig:RowSelectorSettings EnableRowNumbering="False" Visibility="Visible" /> </ig:XamGrid.RowSelectorSettings> </ig:XamGrid>
Am I missing something?
I'm attaching a zip file with a sample project and a screenshot.
Regards,
Hello Nikolay,
Ok now I understand :
To be able to copy selected rows and selected cells, you have to register to this two events : SelectedCellsCollectionChanged and SelectedRowsCollectionChanged.
Then you call a method from this event to set
xamGrid.ClipboardSettings.CopyType = GridClipboardCopyType.SelectedCells; (or GridClipboardCopyType.SelectedRows )
depending on what user just selected.
I don't really understand why this is involved like this, but at leat this way it should work.
Thanks,
Julien Benoit
Hi,
It is possible to have such behaviour. I've attached a sample that demonstrates that.
I hope that this will help you.
If I understand correctly the behavior I want is not possible by design.
I can't have SelectionSettings.CellClickAction = SelectCell to allow my user to select some cells, and a row selector to allow them to select some lines, and copy them to clipboard.
So I can't have an excel like behavior for selection and have copy working at the the same time.
Copying works only with the selected cells (the SelectionSetting.SelectedCells collection) or only with the selected rows (the SelectionSettings.SelectedRows collection).
The selected rows are copied if:ClipboardSettings.CopyType = SelectedRows or ClipboardSettings.CopyType = Default and SelectionSettings.CellClickAction = SelectRow.The selected cells are copied if:ClipboardSettings.CopyType = SelectedCells orClipboardSettings.CopyType = Default and SelectionSettings.CellClickAction = SelectCell.HTH
If I understand correctly, I can either:
but I can't have both behaviors?