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.
Unfortunately, activation email could not send to your email. Please try again.

Pasting over cells with Syles

Thread ID:

Created:

Updated:

Platform:

Replies:

25697 Mar 3,2005 04:37 PM Mar 4,2005 03:36 AM Windows Forms 3
loading
Tags: GridControl
John Baker
Asked On March 3, 2005 04:37 PM

How would I go about removing the style for cells that are changed as a result of a paste event? I am trying to set the style in Grid.CellsChanging, but the grid is aparently ignoring my changes.

Administrator [Syncfusion]
Replied On March 3, 2005 07:04 PM

I am not sure I understand what you need. But if you want to turn off pasting styles (and only paste text), you can set: this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;

John Baker
Replied On March 3, 2005 09:28 PM

Let me try to clarify. I have selected a range A1-A5 (or any arbitrary range from the grid or external source). I set C2 as the current cell. Cells C3 and C5 both have a background color set to Red. Since the range I am pasting will overwrite those cells, I want the red background to go back to white. >I am not sure I understand what you need. > >But if you want to turn off pasting styles (and only paste text), you can set: > >this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles; >

Administrator [Syncfusion]
Replied On March 4, 2005 03:36 AM

Is this a GridControl? If so, try setting e.Style.BackColor in SaveCellInfo for the pasted cells. You can set a flag in gridControl.ClipboardPaste, and test it in SaveCellInfo to indicate you need to set the e.Style.BackColor, and then turn the flag off in gridControl1.Model.ClipboardPasted. If this is a gridDataBoundGrid, then you cannot set backcolors of individual cells. Instead, you woul dneed to handle grid.prepareViewStyleInfo and set e.Style.backColor there dynamically based on e.RowIndex and e.ColIndex. This means you would have to maintin a list of cells you want to specially color, and then check for these cells in PrepareViewStyleInfo.

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.

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.

;