Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
XamPivotGrid Clipboard Operations
posted

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

Parents
No Data
Reply
  • 17559
    posted

    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.

Children