We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag and Drop Excel Formulas

Thread ID:

Created:

Updated:

Platform:

Replies:

69044 Oct 11,2007 03:17 AM UTC Oct 12,2007 09:10 AM UTC WinForms 1
loading
Tags: GridControl
Ben Fraser
Asked On October 11, 2007 03:17 AM UTC

Hello,

I can drag and drop an Excel cell contents over to the grid but if the Excel cell contains a formula I cannot get the formula pasted into the Syncfusion grid.

When I drag and drop a Syncfusion cell about I do get the formula carried along automatically. What do I have to do to get an Excel cell drop to carry along the formula with it?

Thanks,
Ben

Administrator [Syncfusion]
Replied On October 12, 2007 09:10 AM UTC

By default, GridControl supports 2 Clipboard formats. One uses GridStyleInfo objects, and the other is just text.

So, when you copy/paste or D&D from the grid to the grid, then grid can access the style information on the clipboard to handle the formulas.

But when you are coming from excel, there is no style information on the clipboard (or in the drag object), so this means that the grid can only use the text support, which normally only has the computed values from excel and not the formulas.

Here are 2 ways you can address this issue.

The first is simple and requires no coding. In excel, before you copy or initiate a drag, press ctl+` to tell excel to show all formulas. Then the formulas get put on the clipboard as text, and will get pasted into the grid as formulas (as long as you have set up up all cells to be formulas with code such as grid.TableStyle.CellType = "FormulaCell".)

The other way is significantly more work, but does not rely on your users using ctl+` to toggle formula displaying in excel. Instead, it requires that you handle the Paste or the drop in the grid, get the excel object from the clipboard, and handle setting the formulas directly into the grid cells. Our XlsIO would be useful in doing this, but this would take some coding.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;