Hi, Using V2, Adapter and VB.
I'm trying to validate entries made via a grid and I just don't seem to get it
I've created a partial class of my RegionEntity, and defined some simple validation checks for each column. How can I indicate an error at the UI (on the Grid)?
Imports PMIS.DAL
Imports PMIS.DAL.FactoryClasses
Imports PMIS.DAL.HelperClasses
Imports SD.LLBLGen.Pro.ORMSupportClasses
Namespace PMIS.DAL.EntityClasses
Partial Public Class RegionEntity
Protected Overrides Function onvalidateFieldValue(ByVal fieldindex As Integer, ByVal value As Object) As Boolean
Dim toReturn As Boolean = True
Select Case CType(fieldindex, RegionFieldIndex)
Case RegionFieldIndex.RegionCode
'Code must not be blank
If Len(value) < 3 Then
'Indicate the error ????
toReturn = False
End If
Case RegionFieldIndex.RegionName
'UN Region Name must not be blank
toReturn = (Len(value) > 0)
Case RegionFieldIndex.ComSecRegionName
'Must not be blank
toReturn = (Len(value) > 0)
End Select
End Function
End Class
End Namespace
If I have to report the error within the UI, how do I pickup the return value (toReturn) from the grid?
Is it significant that parameter onvalidateFieldValue in
Protected Overrides Function onvalidateFieldValue(ByVal fieldindex As Integer, ByVal value As Object) As Boolean
is being displayed the way it was typed i.e. Intellisense did not complete the text. Does this indicate that I'm missing a reference to what??
Finally, after entering data in a cell, this value is removed when the focus moves to the next cell/field.
I don't think I'm too far off, but I'm really stuck
any comments would help.
Thanks