Custom copy paste

Posted by: akhabarov on 25 February 2020, 8:07 am EST

    • Post Options:
    • Link

    Posted 25 February 2020, 8:07 am EST

    Hello,

    I’ll need to create custom copy/paste because underlying data-structure quite complex and direct copy paste won’t work.

    I planned to use pasting. The problem is CellRangeEventArgs contains only displayed text. Is it possible to get row (cells) underlying data-structure for the copied cells?

  • Posted 25 February 2020, 3:50 pm EST

    Hi Andrei,

    Can you please explain your exact requirements so that we can assist you further?

    Regards,

    Ashwin

  • Posted 26 February 2020, 3:47 am EST

    I have data structure with lots of nested classes. I use master-details grids. To display it in masted grid I aggregate data from nested arrays and display summary on top.

    Master grid [(itemsSource)]=“samples” which is array of type Sample. Sample has property Sample.samplePackage which in turn has array Sample.samplePackage.packages of type Package. Package has property name.

    So, in master in column “Analysis” I display all Package.name for all packages from Sample.samplePackage.packages like “Package1, Package2, and so on”

    We want to be able to copy all packages in one copy-paste operation in Master grid. Basically it means I need to copy entire underlying data-structure.

    For the example I need to copy whole array Sample.samplePackage.packages into other new or existing Sample.

    Any advice how to do it?

  • Posted 26 February 2020, 4:08 pm EST

    Hi,

    So basically your requirement is to copy the whole data item of the row instead of just the displayed data. You can do this by handling the copying and pasting event of the FlexGrid and use the Wijmo’s Clipboard class to copy and paste the data manually.

    Please refer to the sample link below:

    https://stackblitz.com/edit/angular-chgret

    ~regards

  • Posted 21 October 2020, 2:34 am EST

    Hi there…

    I would like some customization here too.

    Imagine that I have a column using cellTemplate to create a hyperlink.

    But… in some of this columns user wants to copy the label, in others he wants to copy the link itself.

    This can be easily done by inverting the bidding property. I will have to handle SortConverter, FilterConverter(ish), GroupDescriptor cos this actions will always use the hyperlink label.

    Is there an easier way to achieve it?

    Thank’s

  • Posted 22 October 2020, 1:31 am EST

    Hi Ricardo,

    If I understand correctly, in your application you have two columns with links in which one needs to copy the label on the clipboard whereas the other needs to copy the underlying link address. This could be easily achieved by handling copying event and using Wijmo’s Clipboard to copy the required text on the clipboard. Please refer to the following sample which demonstrates the same and let us know if you face any issues:

    https://stackblitz.com/edit/angular-zy5xfu?file=src%2Fapp%2Fapp.component.ts

    Regards

  • Posted 23 October 2020, 2:50 am EST

    Hi Sharad!

    It does help… sometimes we just think too difficult! =D

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels