StrataFrame Forum

Editing State Changed question...

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

By StarkMike - 9/18/2006

I have created a DevExpress maintenance form. If I have controls on the form that are not bound to any data but I want them to disable when I enter an editing mode how would I do that? Because I see not way to modify or add to the event handlers for the buttons on the toolstrip.



After some looking here is how I answered my own question... just want to make sure this is the "best practices" solution.





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

Select Case e.EditingState

Case MicroFour.StrataFrame.Business.BusinessEditingState.Adding, MicroFour.StrataFrame.Business.BusinessEditingState.Editing

Me.btnSearch.Enabled = False

Me.txtSearch.Enabled = False



Case MicroFour.StrataFrame.Business.BusinessEditingState.Idle

Me.btnSearch.Enabled = True

Me.txtSearch.Enabled = True



End Select

End Sub





P.S. any idea why my quote tag didnt work?
By Trent L. Taylor - 9/18/2006

If I have controls on the form that are not bound to any data but I want them to disable when I enter an editing mode how would I do that?

This is not tied to the MaintenanceFormToolstrip, it is tied to a business object.  The maintenance form toolstrip just works through the integrity of the framework, so an Add just calls the Add() on the form, which in turn calls the Add() on a business object.

All you need to do is capture the EditingStateChanged event of a business object and place your code there.

As for you quote not working, I don't know.  I will have to look into it later.  Thanks. Smile