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.

Paste

Thread ID:

Created:

Updated:

Platform:

Replies:

15720 Jun 25,2004 07:43 AM Jun 25,2004 08:38 AM Windows Forms 3
loading
Tags: GridControl
Francis Ouellet
Asked On June 25, 2004 07:43 AM

How can I cancel a paste in a particular row int the grid? IN VB.NET please.

Administrator [Syncfusion]
Replied On June 25, 2004 07:54 AM

You can handle the grid.Model.PasteCelltext event. ''in formload AddHandler Me.GridDataBoundGrid1.Model.PasteCellText, AddressOf gridModel_PasteCellText
''the handler
Private Sub gridModel_PasteCellText(ByVal sender As Object, ByVal e As GridPasteCellTextEventArgs)
        If e.RowIndex = 2 Then ''dont paste into row 2
            e.Cancel = True
        End If
    End Sub

Francis Ouellet
Replied On June 25, 2004 08:19 AM

The event never fire. The grid is on an mdiChild form. >You can handle the grid.Model.PasteCelltext event. > >''in formload > AddHandler Me.GridDataBoundGrid1.Model.PasteCellText, AddressOf gridModel_PasteCellText > > >
>''the handler
>Private Sub gridModel_PasteCellText(ByVal sender As Object, ByVal e As GridPasteCellTextEventArgs)
>        If e.RowIndex = 2 Then ''dont paste into row 2
>            e.Cancel = True
>        End If
>    End Sub
>

Administrator [Syncfusion]
Replied On June 25, 2004 08:38 AM

The event fires when you are pasting text information, but not style information. So, the event should fire if you are using a GridDataBoundGrid, or if you are using a GridControl and pasting information copied from outside the grid. If you are using a GridControl, and want to copy jsut text information from a grid (as opposed to just the cell style information), then you can turn off support for copying styles by setting Me.GridDataBoundGrid1.Model.CutPaste.ClipboardFlags = GridDragDropFlags.Text (you also may want to set some other flags there are well). But if you want to copy styles, this event will not work for you. In that case, you would have to handle ClipboardPaste which will be more work since it is not called on a cell by cell basis.

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.

;