Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
InvalidCastException when DEL key pressed
posted

Hi, I have a weird problem when using the UltraGrid.

I have a basic ultragrid that is bound to a bindingsource that includes items from a bindinglist<T>.

Everything works fine except when the user edits numeric cells and hits DEL / BACKSPACE -button to clear the cell. An unhandled exception pops up with the following message:
------------------------------------------------
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
   at Infragistics.Win.EditorWithText.Infragistics.Win.IEmbeddableTextBoxListener.OnTextChanged()
   at Infragistics.Win.EmbeddableTextBox.OnTextChanged(EventArgs e)
   at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at Infragistics.Win.EmbeddableTextBoxWithUIPermissions.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--------------------------------------------------

I should mention that I am using a DataFilter on the some of the cells to format null values.

But how can a trap this exception to get a better idea what's happening?
Anyone have an idea what could be causing this?