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.

clipboard/pastecelltext event ?

Thread ID:

Created:

Updated:

Platform:

Replies:

29172 May 18,2005 10:25 AM May 18,2005 11:35 AM Windows Forms 1
loading
Tags: GridControl
Philip Bishop
Asked On May 18, 2005 10:25 AM

I have a question about the clipboard and how the pastecelltext event gets fired? I have a pastecelltext event that looks as follows.... Private Sub grdRErPA_PasteCellText(ByVal sender As System.Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventArgs) Handles grdRErPA.PasteCellText If CType(e.Style, Syncfusion.Windows.Forms.Grid.GridStyleInfo).ReadOnly Then e.Cancel = True End If Try Dim i As Single = Single.Parse(e.Text) Select Case i Case 0, 301.0F To 332.0F Case Else Throw New Exception("") End Select Catch display error message e.Abort = True End Try End Sub My question is this. If im copying a value of say 201 from one cell to one cell on this form it will fire this event and will display the proper error message. If however the clipboard has string.empty or "" in it and the user does a paste it never goes to the pastecelltext event. How does it know not to fire the event based on it being null or having invalid data? What says dont fire the event if its string.empty in the clipboard versus a invalid number inthe clipboard? Thanks

Administrator [Syncfusion]
Replied On May 18, 2005 11:35 AM

When this code returns psz = "", then no pasting is done and PasteCelltext is not raised.
string psz = null;
if (iData.GetDataPresent(DataFormats.UnicodeText))
	psz = iData.GetData(DataFormats.UnicodeText) as string;
else if (iData.GetDataPresent(DataFormats.Text))
	psz = iData.GetData(DataFormats.Text) as string;
This code is in GridModelDatabinder.cs, the DataBoundPaste method.

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.

;