Home Forums WinForms controls Xceed Grid for WinForms Invalid cast to System.Nullable types in Xceed Grid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17283 |

    I’m working with a VB .Net Winforms application using MS Entity Framework and Xceed Grid.  I’ve run into a problem where I can not change the value of columns in the grid that are bound to System.Nullable(OF xxx) due to a casting error.

     Any thoughts on how I might resolve this issue?

    Thanks,
    Stephen

     Error message trapped in datarowtemplate validationerror event:

    Invalid cast from ‘System.Decimal’ to ‘System.Nullable`1[[System.Decimal, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]’.

    Stack Trace:

    > Rei.Repss.exe!Rei.Repss.TestGrid.celldataRowTemplate1UnitQty_ValidationError(Object sender = {Xceed.Grid.DataCell}, Xceed.Grid.CellValidationErrorEventArgs e = {Xceed.Grid.CellValidationErrorEventArgs}) Line 65 Basic
      [Native to Managed Transition] 
      [Managed to Native Transition] 
      mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args) + 0x55 bytes 
      mscorlib.dll!System.Delegate.DynamicInvoke(object[] args) + 0x8 bytes 
      Xceed.Grid.dll!Xceed.Grid.GridElement.RaiseEvent(object eventKey = {object}, System.EventArgs e = {Xceed.Grid.CellValidationErrorEventArgs}) + 0x95 bytes 
      Xceed.Grid.dll!Xceed.Grid.Cell.OnValidationError(Xceed.Grid.CellValidationErrorEventArgs e = {Xceed.Grid.CellValidationErrorEventArgs}) + 0x2b bytes 
      Xceed.Grid.dll!Xceed.Grid.CellEditorManagerCore.EndEdit(bool commit = true) + 0x4c2 bytes 
      Xceed.Grid.dll!Xceed.Grid.CellRow.EndEdit() + 0x128 bytes 
      Xceed.Grid.dll!Xceed.Grid.GridControl.ProcessCmdKey(ref System.Windows.Forms.Message msg = {msg=0x100 (WM_KEYDOWN) hwnd=0x290726 wparam=0xd lparam=0x1c0001 result=0x0}, System.Windows.Forms.Keys keyData = LButton | MButton | Back) + 0x27c bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) + 0x96 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.ProcessCmdKey(ref System.Windows.Forms.Message msg = {msg=0x100 (WM_KEYDOWN) hwnd=0x290726 wparam=0xd lparam=0x1c0001 result=0x0}, System.Windows.Forms.Keys keyData = LButton | MButton | Back) + 0x15 bytes 
      Xceed.Grid.dll!Xceed.Grid.EditorContainer.ProcessCmdKey(ref System.Windows.Forms.Message msg = {msg=0x100 (WM_KEYDOWN) hwnd=0x290726 wparam=0xd lparam=0x1c0001 result=0x0}, System.Windows.Forms.Keys keyData = LButton | MButton | Back) + 0x78 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) + 0x96 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) + 0x96 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.TextBoxBase.ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) + 0xda bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessMessage(ref System.Windows.Forms.Message msg) + 0x90 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Control.PreProcessControlMessageInternal(System.Windows.Forms.Control target = {Text = “2.5500000”}, ref System.Windows.Forms.Message msg = {msg=0x100 (WM_KEYDOWN) hwnd=0x290726 wparam=0xd lparam=0x1c0001 result=0x0}) + 0x101 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg = {System.Windows.Forms.NativeMethods.MSG}) + 0xf6 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(ref System.Windows.Forms.NativeMethods.MSG msg) + 0x5 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x22e bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.WinFormsAppContext}) + 0x177 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x61 bytes 
      System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.ApplicationContext context) + 0x18 bytes 
      Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() + 0x81 bytes 
      Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() + 0xef bytes 
      Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine) + 0x2c0 bytes 
      [Native to Managed Transition] 
      [Managed to Native Transition] 
      mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x3a bytes 
      Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b bytes 
      mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes 
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes 
      mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes 

    Imported from legacy forums. Posted by Stephen (had 2232 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Stephen,

    Could you send us a sample project which demonstrates the issue so that we may investigate this problem? Please send it to support@xceed.com and include a link to this forum thread for reference. Thank you.

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 979 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.