Editing State Changed question...


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
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?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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

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