Hi,
Does the XamPivotGrid support clipboard operations. I would like to select a row/column or hierarchie and copy paste all selected cells into Excel. The XamDataGrid can easily do this through Clipboard operations, is there a simple way of doing it with the XamPivotGrid?
Thanks,Nick
Hello Nick,
I have been looking into your question and I believe that you can achieve the functionality that you require with our XamPoivotGrid. In order to achieve this you can try to handle the usercontrol’s KeyDown event and there to save to clipboard all of the selected cells. For example you can copy to clipboard the whole selected row as follows:
private void pivotGrid_KeyDown(object sender, KeyEventArgs e)
{
StringBuilder clip= new StringBuilder();
if (e.Key == Key.C&&(ModifierKeys.Control==Keyboard.Modifiers))
foreach (PivotDataRow row in pivotGrid.SelectionSettings.SelectedRows)
foreach (PivotCell c in row.Cells)
clip.Append(c.Control.Content.ToString() + '\t');
Clipboard.SetText(clip.ToString());
}
If you need any further assistance on this matter, please do not hesitate to ask.
Hi Elena,
Thanks for the reply, however this appears to work only for the cells in my current view. If i have 10 cells and the first 5 of them are in view the values for those 5 are copied. If i scroll the next 5 into view then only they are copied even though i am selecting the whole row.
Basically c.Control is set to null for any cell that is not in view because of the grid virtualisation.
Regards,Nick