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

locking down grid when copying and pasting

Say you have a grid that has 10 rows. Then say a user copies 10 rows from like excel and then tries to paste those 10 into your grid but they click the last row in the grid and then paste. The way it works now is it pastes one row into our last row and then makes 9 new rows so now our grid has 19 rows. Is there any simple way to lock the grid down so if they try to paste and its going to go outside the grid that it wont let them. It would do as much as it can and then truncate the rest. So in that last scenario i gave u it would of pasted the first copied row in the last row in my grid and then stop and not make any new rows???? Thanks Phil

3 Replies

AD Administrator Syncfusion Team March 22, 2004 01:53 PM UTC

There is a property flag that controls whether or not rows/columns can be appended during a paste. Me.GridControl1.Model.CutPaste.ClipboardFlags = Me.GridControl1.Model.CutPaste.ClipboardFlags _ Or GridDragDropFlags.NoAppendRows _ Or GridDragDropFlags.NoAppendCols


PB Philip Bishop March 22, 2004 02:11 PM UTC

Clay, Again thanks for the unbelievable 7-minute response time. WOW. My only other question is where could i have found that answer myself without asking you? Thanks again Phil


AD Administrator Syncfusion Team March 22, 2004 02:56 PM UTC

I found it by looking up Paste in the VisStu help to see this link: ms-help://MS.VSCC/Syncfusion.Essential_Suite/Syncfusion.EssentialSuiteClassRef/Syncfusion.EssentialSuiteClassRef/Syncfusion.Grid~Syncfusion.Windows.Forms.Grid.GridModelCutPaste~Paste.html There is is a statement saying use ClipboardFlags to customize default behavior with a hot link to ClipboardFlags that eventually will get you to ms-help://MS.VSCC/Syncfusion.Essential_Suite/Syncfusion.EssentialSuiteClassRef/Syncfusion.EssentialSuiteClassRef/Syncfusion.Grid~Syncfusion.Windows.Forms.Grid.GridDragDropFlags_members.html where the flags are defined.

Loader.
Up arrow icon