I have a cell with value -100, celltype is double, the cell''s format is "0.00;(0.00)", so the cell display 100.
If I copy the cell to another cell, the target cell display 100, celltype is string, and cell format is "".
Can I copy the whole gridstyleinfo to another cell?
ADAdministrator Syncfusion Team March 18, 2004 06:13 AM
If you are copying from one GridControl to another GridControl, the default behavior is to copy the style.
But if you are using a GridDataBoundGrid, then it normally only copies text. The reason is that cells in a GridDataBoundGrid ''inherit'' the style properties (than the cell text) from the GridBoundColumn.StyleInfo for that column. Individual cells to not save style properties.
One way you can handle this is to subscribe to the ClipboardCopy event, and handle all the work yourself. You can place whatever you want on the clipboard, and that could be pasted later.
If you look at this forum thread, http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=9906, it has code to use clipboardcopy. Now you would not want to skip the hidden columns (maybe, ???), and instead of using the GridData object (that only applies to GridControl), you would index the GridDataBoundGrid and retrieve its formattedtext property.
s += this.gridDataBoundGrid[row, col].FormattedText;