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. Image for the cookie policy date

GridControl ClipboardPaste Event

Hello! I Copy some text from Excel and Paste it to the GridControl grid. If no. of Columns Copied from Excel are greater than the ColCount of GridControl, it simply adds more columns to the grid, a behaviour that I don''t want in my task. I started to use ClipboardPaste Event and tried to check the Range in GridCutPasteEventArgs''s RangeList.ActiveRange GridRangeInfo. But when I copy something from out of the Grid and want to paste it to the grid, e.RangeList.ActiveRange returns null, i-e. I could not check the copied data range. Is there anyway to restrict grid to not adding more columns while copy/pasting data from Excel???

2 Replies

AD Administrator Syncfusion Team September 11, 2004 07:37 AM UTC

There is a property flag that controls whether or not rows/columns can be appended during a paste.
this.gridControl1.CutPaste.ClipboardFlags |= 
     (GridDragDropFlags.NoAppendCols | 

Me.GridControl1.Model.CutPaste.ClipboardFlags = Me.GridControl1.Model.CutPaste.ClipboardFlags _
          Or GridDragDropFlags.NoAppendRows _
          Or GridDragDropFlags.NoAppendCols

MA Maqsood Ahmed September 11, 2004 08:18 AM UTC

Thanks for your answer. Its working fine now

Live Chat Icon For mobile
Up arrow icon