StrataFrame Forum

Event BeforeEdit

http://forum.strataframe.net/Topic16040.aspx

By Angela Sampaio - 4/30/2008

Hello



I noticed that the business objects have the events BeforeSave, BeforeAddNew, BeforeDelete and BeforeUndo.



I need to use an event "BeforeEdit" but i'm not meeting.



Is there any way to do that?



Thanks.
By Edhy Rijo - 4/30/2008

Angela Sampaio (04/30/2008)
I need to use an event "BeforeEdit" but i'm not meeting.

Is there any way to do that?

Thanks.

Hi Angela,

I don't see any Before Edit, but you may be able to do something like this:

Private Sub CustomersBO1_EditingStateChanged(ByVal e As MicroFour.StrataFrame.Business.EditingStateChangedEventArgs) Handles CustomersBO1.EditingStateChanged

     If e.EditingState = MicroFour.StrataFrame.Business.BusinessEditingState.Editing Then

          '-- Check your conditions here and undo the editing if needed.

          Me.CustomersBO1.Undo(MicroFour.StrataFrame.Business.BusinessUndoType.CurrentRowOnly)

     End If

End Sub

I am not sure it will work for you, but it may give you an idea. Wink

By Trent L. Taylor - 4/30/2008

Edhy is right.  You will either want to use the EditingStateChanged event or the IsDirtyChanged event.  Those would be your two options.  It would be difficult to have a BeforeEdit event as this is really down at the column level and could add a lot of overhead if it were in fact checked each time a row column state changed.  So you will want to do this in one of the two aforementioned events. Smile
By Angela Sampaio - 5/2/2008

Thanks!

I think that this will help me. BigGrin