GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

Erro when pasting after installing latest release

Last post 01-27-2010, 7:45 AM by SureshD. 13 replies.
Sort Posts: Previous Next
  •  06-29-2009, 2:02 PM 79618

    Erro when pasting after installing latest release

    Hello,

    After installing the latest WinForms release, we are now getting an error when attempting to paste text into a cell.

    The cell type = NumberCellType

    We bind the grid to a datasource. Not all rows will have a value set for this column. If you try to paste a numeric value into one of the cells with no value, you will get the error isted below.

     Error: {"Object reference not set to an instance of an object."}

    Stack Trace:

    at a1.a(String A_0, Int32 A_1, String A_2, Boolean A_3, String& A_4, Int32& A_5, Boolean& A_6)
       at a1.a(String A_0, Int32 A_1, Int32 A_2, String A_3, String& A_4, Int32& A_5, Boolean A_6)
       at FarPoint.Win.SuperEdit.SEditTextBox.PasteFromClipboard()
       at FarPoint.Win.SuperEdit.SEditTextBox.ProcessAlphaNumericSysKey(Message& msg)
       at FarPoint.Win.InputTextBox.ProcessAlphaNumericSysKey(Message& msg)
       at FarPoint.Win.SuperEdit.SEditTextBox.ProcessWMKeyDownMsg(Message& msg)
       at FarPoint.Win.InputTextBox.SEditProcessWmKeyDownMsg(Message& msg)
       at FarPoint.Win.InputTextBox.ProcessKeyMessage(Message& msg)
       at System.Windows.Forms.Control.WmKeyChar(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
       at System.Windows.Forms.TextBox.WndProc(Message& m)
       at FarPoint.Win.SuperEdit.SEditTextBox.WndProc(Message& m)
       at FarPoint.Win.InputTextBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at JCP.Marketing.MPM.Presentation.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

  •  06-29-2009, 2:17 PM 79620 in reply to 79618

    Re: Erro when pasting after installing latest release

    I noticed that this error does not occur, when I comment out the MinimumValue and MaximumValue properties when defining the column. (See Column definition below)

     

    .Columns(3).DataField = "CopyQty"

    numCellType = New FarPoint.Win.Spread.CellType.NumberCellType

    numCellType.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional

    numCellType.DecimalPlaces = 0

    numCellType.MinimumValue = 1

    numCellType.MaximumValue = 10000

    numCellType.Separator = ","

    numCellType.ShowSeparator = True

    numCellType.NullDisplay = String.Empty

    .Columns(3).CellType = numCellType

    .Columns(3).Locked = False

    .Columns(3).Width = 60

  •  06-29-2009, 2:38 PM 79621 in reply to 79620

    Re: Erro when pasting after installing latest release

    Boomer,

    I tried pasting the text value in a numeric cell and was able to do so (the pasted text value does nit persist in the numeric cell, but it display it there) without any exception being thrown. I did not set any value for the Minimum and Maximum value of Numeric cell and did not get any exception as reported by you.

    Thanks


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  06-29-2009, 2:49 PM 79622 in reply to 79621

    Re: Erro when pasting after installing latest release

    Did you also try it with setting the min and max values? That is when I get the exception.

  •  06-29-2009, 3:10 PM 79625 in reply to 79622

    Re: Erro when pasting after installing latest release

    Boomer,

    Even with the Maximum and Minimum values set as mentioned by you, I am still not getting any exception as outlined by you.


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  06-29-2009, 3:21 PM 79626 in reply to 79625

    Re: Erro when pasting after installing latest release

    Attachment: PasteError.zip
    I have attached a solution. Try posting a numeric value in any of the empty cells. If you get the error, comment out the min and max size properties and try again.
  •  06-29-2009, 5:09 PM 79630 in reply to 79626

    Re: Erro when pasting after installing latest release

    Boomer,

    Thanks for providing the sample project, I was able to reproduce the issue at my side and reported this as bug # 26209. This should get fixed in the next maintenance release of the control.



    Suresh Singh Dasila
    GrapeCity FarPoint
  •  06-29-2009, 5:28 PM 79631 in reply to 79630

    Re: Erro when pasting after installing latest release

    Can you recommend a quick workaround for now? We have about 30 screens in our application that are affected by this. Unfortunately, this is a very significant defect for us.

  •  06-30-2009, 9:44 AM 79668 in reply to 79631

    Re: Erro when pasting after installing latest release

    Hello,

    Using your sample project I noticed that the exception is raised only when you try to paste the Data into a cell after getting into Edit Mode(by double clicking the cell or by pressing the Enter key).If you paste the data in a cell without getting into Edit Mode it doesn't raise the Exception. Else you can add the following code to check the minimum  and maximum limit for the cell data in LeaveCell event while deleting numCellType.MinimumValue = 1 and numCellType.MaximumValue = 10000.

    Private Sub FpSpread1_LeaveCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Handles FpSpread1.LeaveCell

    If FpSpread1.Sheets(0).Cells(e.Row, e.Column).Value < 1 Or FpSpread1.Sheets(0).Cells(e.Row, e.Column).Value > 10000 Then

    FpSpread1.Sheets(0).Cells(e.Row, e.Column).Value = " "

    End If

    End Sub

    Hope it will help you.

    Thanks,


    Deepak Sharma
    GrapeCity FarPoint
  •  06-30-2009, 11:34 AM 79680 in reply to 79668

    Re: Erro when pasting after installing latest release

     

     By adding this code (See below), I am able to work around it. Because our grid is a user control, which inherits from FarPoint, I was able to add this to the control and fix all screens at once. Please let me know if you see any possible issues with this workaround.

     Private Sub FpSpread1_ClipboardPasting(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.ClipboardPastingEventArgs) Handles FpSpread1.ClipboardPasting

    FpSpread1.ActiveSheet.ActiveCell.Value = Clipboard.GetText().Trim()

    e.Handled = True

    End Sub

  •  06-30-2009, 1:29 PM 79687 in reply to 79680

    Re: Erro when pasting after installing latest release

    Boomer,

    Your workaround seems fine to me and also Deepak's observations/workaround regarding the edit mode works correctly as well.

     


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  06-30-2009, 2:21 PM 79689 in reply to 79687

    Re: Erro when pasting after installing latest release

    Thanks for the reply.

    The users need to be able to type or paste into a cell, so I'm not sure how you prevent edit mode from occurring, while allowing both types of input.

     

  •  06-30-2009, 4:33 PM 79695 in reply to 79689

    Re: Erro when pasting after installing latest release

    Boomer,

    If we can not set the edit mode off (as per requirement), then you may use the workaround suggested by you. As it has already been reported as a bug, which should also gets fixed in next maintenance release.

    Thanks


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  01-27-2010, 7:45 AM 86883 in reply to 79695

    Re: Erro when pasting after installing latest release

    Boomer,

    While investigating the bug# 26209 further, we were not able to reproduce this using Spread4.0.3510.2008. Is this an intermittent issue? Are there any additional steps required to reproduce this? As I was able to replicate it earlier. but not anymore.



    Suresh Singh Dasila
    GrapeCity FarPoint
View as RSS news feed in XML
     FarPoint Forums Home