copy a cell with formatting

How to copy a complete cell wih its formatting ? Here is my use case: Let's suppose I have a dropdown in row 3, col 4. I need to insert a line in row 3 -> my dropdown will move down 1 row but I would like to move it again to row 3 where it was before the line insertion. What's the "right" way to do this ?

1 Reply

AD Administrator Syncfusion Team February 26, 2007 05:22 PM UTC

Hi Christian,

You can turn on the Styles flag in the ClipboardFlags property.

this.gridControl1.Model.CutPaste.ClipboardFlags = GridDragDropFlags.Styles;

and use the below code snippet to copy and insert the simillar row at 3rd position.

this.gridControl1.Model.Selections.Clear();
this.gridControl1.Model.Selections.Add(GridRangeInfo.Row(3));
this.gridControl1.Model.Rows.InsertRange(4,1);
this.gridControl1.Model.CutPaste.Copy();
this.gridControl1.Model.Selections.Clear();
this.gridControl1.Model.Selections.Add(GridRangeInfo.Row(4));
this.gridControl1.Model.CutPaste.Paste();

Sample : GC_AutoSize.zip

Best regards,
Haneef

Loader.
Up arrow icon