The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator Syncfusion Team March 4, 2005 12:04 AM UTC
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;
JBJohn BakerMarch 4, 2005 02:28 AM UTC
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;
>
ADAdministrator Syncfusion Team March 4, 2005 08:36 AM UTC
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.