dragonwell
Programmer
I am binding an editable DataGrid to an ArrayList. The objects in the ArrayList are of a class in my program which has this property
If I edit the Capacity column in my DataGrid, and enter a value less than 0, I am expecting the exception to be thrown. It is getting thrown - but who is handling it? All that happens is the value is not set. In fact, if I enter a non-integer string, the same thing happens - I guess the question is "where is the value of what is entered into a DataGrid validated?"
I would like to be able to inform the user of this business rule while they edit the object in the DataGrid, not simply reject their values.
Thanks for you help!
Code:
Public Property Capacity() As Integer
Get
Return Me._capacity
End Get
Set(ByVal value As Integer)
If value < 0 Then
Throw New ApplicationException("Capacity must be more than 0.")
End If
Me._capacity = value
End Set
End Property
If I edit the Capacity column in my DataGrid, and enter a value less than 0, I am expecting the exception to be thrown. It is getting thrown - but who is handling it? All that happens is the value is not set. In fact, if I enter a non-integer string, the same thing happens - I guess the question is "where is the value of what is entered into a DataGrid validated?"
I would like to be able to inform the user of this business rule while they edit the object in the DataGrid, not simply reject their values.
Thanks for you help!