Home Forums WinForms controls Xceed Grid for WinForms first-chance error

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

    How can I to intercept the following First-chance exception without to set the Debugger to “Continue”?

    Sub Cell_LeavingEdit(ByVal sender As Object, ByVal e As LeavingEditEventArgs)

    If …. then

    e.Cancel = True ‘<<<<<< First-chance error: the cell’s attempt to leave edit mode has been cancelled.

    end if

    End Sub

    Thanks!

    Imported from legacy forums. Posted by AndreaZ (had 1842 views)

    User (Old forums)
    Member
    Post count: 23064

    All the code:

    Dim myColumnCash As New System.Data.DataColumn(“”, GetType(Double)) ‘<<DOUBLE!!
    myDtCashFlow.Columns.Add(myColumnCash)

    Grid1.SetDataBinding(myDS, myDtCashFlow.ToString)

    Dim MaskCash As New GridNumericTextBox
    Grid1.Columns(“Cash”).CellEditor = MaskCash

    For Each cell As DataCell In Grid1.DataRowTemplate.Cells
    AddHandler cell.LeavingEdit, AddressOf CellLeavingEdit
    AddHandler cell.ValidationError, AddressOf CellValidationError
    Next

    Sub CellLeavingEdit(ByVal sender As Object, ByVal e As LeavingEditEventArgs)
    If e.NewValue <> “” And Not IsNumeric(e.NewValue) Then ‘<< if CTRL+V = “Hello!!”
    messagebox.show ….
    e.Cancel = True ‘<< !!!
    End If
    End Sub ‘<<<<<<<<<<<<< EXCEPTION FIRST-CHANCE !!! 🙁

    The CellValidationError isn’t throw.

    Thanks!

    Imported from legacy forums. Posted by AndreaZ (had 2907 views)

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