Drag and Drop with Value only

Posted by: thanh.minh.le on 5 March 2023, 8:35 pm EST

    • Post Options:
    • Link

    Posted 5 March 2023, 8:35 pm EST


    Your support is awesome!

    Can I ask if there is currently a way to set up the Drag & Drop feature for value only? Like fillWithoutFormatting or Paste without formula & formatting.

    Because currently, if the user uses this feature, it will change the style settings on the sheet.

    I have checked the DragDropBlock event and may not be able to set args.copyOption



  • Posted 7 March 2023, 4:47 am EST

    Hello Thanh,

    I hope this message finds you well. I understand that you are interested in implementing the drag & drop feature with values only. If it’s okay with you, I would like to offer a suggestion that may help you achieve this goal.

    To accomplish this, you can bind an event handler to the DragDropBlock event, and in the event args of the handler, change the args.copyOption property to GC.Spread.Sheets.CopyToOptions.value. This will enable you to drag and drop cell ranges with values only.

    I kindly ask that you refer to the code snippet and attached sample provided in the documentation for further guidance. If you face any issues, please do not hesitate to let us know, and we’ll be more than happy to assist you.

        spread.bind(GC.Spread.Sheets.Events.DragDropBlock, (event, args) => {
            args.copyOption = GC.Spread.Sheets.CopyToOptions.value;

    Documentation references:

    DragDropBlock event: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Events#dragdropblock

    CopyToOptions enumeration: https://www.grapecity.com/spreadjs/api/enums/GC.Spread.Sheets.CopyToOptions

    Sample: https://jscodemine.grapecity.com/share/LPkNRKyra0qPbKKPWkxb9w/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}



Need extra support?

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

Learn More

Forum Channels