1

am using devexpress 16.1, in my grid i want to copy selected cells with depending columns header. in my grid options i enabled,

GridView1.OptionsClipboard.AllowCopy = DefaultBoolean.True
GridView1.OptionsClipboard.CopyColumnHeaders = DefaultBoolean.True

but its don't copy column header with selected cells.

Thanks in Advance

Shankar
  • 45
  • 8
  • use `Clipboard.SetText("your contents here);` to copy into clipboard – Subaz Sep 20 '17 at 09:46
  • Content only need, that my question here, while selecting multiple cells its copy to clip, but i need cell values with corresponding column header values – Shankar Sep 20 '17 at 10:09
  • What happens if you invoke the GridView's CopyToClipboard method? https://documentation.devexpress.com/WindowsForms/DevExpress.XtraGrid.Views.Base.BaseView.CopyToClipboard.method – Brendon Sep 20 '17 at 13:16
  • @Brendon , its copy only cells values not with responding column – Shankar Sep 21 '17 at 04:18
  • Where do you paste the copied text/headers to? – Brendon Sep 21 '17 at 14:25
  • like notepad file, i will paste what am copied from devexpress grid – Shankar Sep 22 '17 at 07:19

1 Answers1

0

I suppose the CopyToClipboard() method must be used.

This copied code works to me on v15.1.7

    ((GridView)FocusedView).OptionsBehavior.CopyToClipboardWithColumnHeaders = true;
    FocusedView.CopyToClipboard();