StrataFrame Forum

Maintenance Form question...

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

By StarkMike - 1/15/2007

I love the Maintenance Form template and would like to use it with a grid. Was it designed for that? I know it works well when you drop textboxes and comboboxes on it and only want to view one record at a time but I'd like to use a grid and still retain the toolbar functionality.



I came across this property, AllowMultipleModifiedRecords, for the MaintenanceToolstrip and wondered if setting this to true was all i needed to do.



The second part of my question is, aside from writing code behind the form, how do i get a grid to enable/disable in conjunction with the maintenance form template. I'm assuming that there might be an interface i'd have to implement or I might have to create a custom class and Inherit a grid... I'm just curious. BigGrin
By StrataFrame Team - 1/15/2007

Yes, you can use a grid with the maintenance form... just remember to use a BusinessBindingSource.  As for enabling/disabling the grid... you just need to handle the EditingStateChanged event of the bound business object and set the Enabled property of the depending upong the editing state of the business object... Idle, Editing, or Adding.

Me.myGrid.Enabled = (Not e.EditingState = EditingState.Idle)

By StarkMike - 1/15/2007

Thanks Ben. What if i want to develop a control than handles that automatically... how would I do that or what would i implement?
By StarkMike - 1/15/2007

Ok, I've got a Maintenance form and am using a BusinessBindingSource. Do I need to set AllowMultipleModifiedRecords to True? And when I enter edit mode ... if I hit undo it will undo all changes correct?
By StrataFrame Team - 1/15/2007

Yes, it will undo all changes.  And you can leave the AllowMultipleModifiedRecords property alone if you want... it's meant to disable the navigation buttons on the toolstrip when the business object is editing.  But, since you have a grid, people can move to a different record simply by clicking the corresponding row.