Hi,
I have a grid that reads in a bunch of number values from a database. These values are only ever either INT or Decimal(x,x)
When I try this after a UltraGrid AfterCellUpdate
if((Double)e.Cell.Value > 0)
But recieve an error that specific cast is not valid. The type returned by e.cell.value is Decimal and the Value = 3 in this test.
I tried this out and it works just fine for me.
What exactly is the exception? What does the call stack look like?
Line of Code in AfterCellUpdate event.
if
((double)e.Cell.Value < 0)
System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="UGTest" StackTrace: at Mitsic.frmcEquipment.ugEquip_AfterCellUpdate(Object sender, CellEventArgs e) in C:\Documents and Settings\rand\My Documents\Visual Studio 2008\Projects\UGTest\UGTest\frmcUgTestt.cs:line 7532 at Infragistics.Win.UltraWinGrid.UltraGrid.OnAfterCellUpdate(CellEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e) at Infragistics.Win.UltraWinGrid.UltraGridCell.SetValueInternal(Object value, Boolean suppressErrorMessagePrompt, Boolean fireInitializeRow, Boolean throwExceptionOnError, Boolean fireDataChanged) at Infragistics.Win.UltraWinGrid.UltraGridCell.SetValueInternal(Object value, Boolean suppressErrorMessagePrompt, Boolean fireInitializeRow, Boolean throwExceptionOnError) at Infragistics.Win.UltraWinGrid.UltraGridCell.SetValueInternal(Object value, Boolean suppressErrorMessagePrompt, Boolean fireInitializeRow) at Infragistics.Win.UltraWinGrid.UltraGridCell.CommitEditValue(Boolean& stayInEdit, Boolean fireDataError, Boolean forceDontThrowException, Boolean dontStoreInUndoHistory) InnerException: