Welcome to the Xceed Community | Help
Community Search  
More Search Options

ComException (Error en OpenClipboard) in Datagrid 4.3

Sort Posts: Previous Next
  •  02-12-2012, 5:06 AM Post no. 31671

    ComException (Error en OpenClipboard) in Datagrid 4.3

    Hi Xceed,

    With the Datagrid v4.3.12074.17240 of the DataGrid, a user reported me an issue while copying data to the clipboard, with the following stack trace.

    I think it's because only 1 process can open the clipboard so if another process has it opened the subsequent requests will fail until the first releases the clipboard. This was sort of handled in the WinForms Clipboard class where it would retry the set with a delay in between each try, but the WPF clipboard class doesn't do this, so if it fails on the first show the exception occurs.

    The Datagrid should catch the exception and retry the operation later. What do you think?

    Thanks

    Cyber Sinh 

     

    Une exception de type 'System.Runtime.InteropServices.COMException' a été levée :
    Error en OpenClipboard (Excepción de HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))

    en System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
    en System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
    en Xceed.Wpf.DataGrid.DataGridControl.OnCopyExecuted(Object sender, ExecutedRoutedEventArgs e)

     

  •  02-16-2012, 2:13 PM Post no. 31696 in reply to 31671

    Re: ComException (Error en OpenClipboard) in Datagrid 4.3

    Hi Cyber Sinh, 

    We have made a change in the latest version which permits to handle this.  We have exposed the OnCopyExecuted() method on DataGridControl, which is now protected virtual.  You can override this method and enclose the call to base in a try catch statement.  This way you will be able to do what you want. 


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.