Override Property Setter


Author
Message
Ben Kim
Ben Kim
StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)StrataFrame User (133 reputation)
Group: Forum Members
Posts: 99, Visits: 253
Hello all,

Is there a way to override a BO property Setter?  I have tried copying the Property I want to modify into the BO.vb (not the designer file) and apply Overrides to the public property method.  This of course does not compile since the base property is not overridable.

What I would like to do is if a value is changed, automatically UPPERCASE and PadLeft(3) the field, plus call a function to set another field:

Example Setter:

Me.CurrentRow.Item("HairColor") = value.ToUpper.PadLeft(3)
Me.HairColorDescription = GetLookupItem(DepartmentID, TableNumber, Me.CurrentRow.Item("HairColor"))

My initial thought was to UpperCase and Pad the field in the CheckRulesOnCurrentRow event.

Me.HairColor = Me.HairColor.ToUpper.PadLeft(3) !Pad left for sorting purposes
Me.HairColorDescription = GetLookupItem(DepartmentID, TableNumber, Me.HairColor)

The above works.  However as I navigate through the records (even after copying the code to the BO Navigated event), the description seems to always be one behind the current record.  Custom fields and property descriptions have been setup and work so this is not the issue either.

Ideas?

Thanks!

Ben

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search