﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Managing Control Editing State</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 06 Jun 2026 05:25:04 GMT</lastBuildDate><ttl>20</ttl><item><title>Managing Control Editing State</title><link>http://forum.strataframe.net/FindPost13966.aspx</link><description>I'm creating a workflow application and one of the requirements is that the ability to edit&amp;nbsp;individual fields&amp;nbsp;of an object varies depending on the current status of the object in the workflow. This can be done in in the UI but I'm looking for a way to manage it at the BO level and let the SF data binding handle the read only state of the fields on the form. Is this doable? I've tried setting the BindingEditable property of the bound control to false but that didn't work. I also took a look at the ProperyDescriptor but didn't find anything that would work. &lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Tue, 05 Feb 2008 14:29:21 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Managing Control Editing State</title><link>http://forum.strataframe.net/FindPost14040.aspx</link><description>Thanks for the explanation; that's basically what I ended up doing.&amp;nbsp;I was just wondering if there was a better way then simply looping through the collection.&amp;nbsp; &lt;/P&gt;&lt;P&gt;To get the functionality I was looking for I ended up subclassing BusinessLayer, created a list of NonEditableFields, and added methods to Add, Delete, and Clear the list. As the list is updated I update the BoundControls and refresh the Field/s. However since I also want to reference the field names&amp;nbsp;using the field enums generated by SF, things got a little messy since to do that I&amp;nbsp;have to add shadow methods to the inherited BO that in turn call the methods in my custom BusinessLayer. I solved that by creating my own custom template and adding it to visual studio. &lt;/P&gt;&lt;P&gt;Which brings me to; it would be nice if SF provided this functionality, so I wouldn't have to mess with custom templates. Also the logic could be combined with ManagedReadOnlyState which would be a cleaner solution. Or maybe there is a&amp;nbsp;simpler solution that I haven't thought of.</description><pubDate>Tue, 05 Feb 2008 14:29:21 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Managing Control Editing State</title><link>http://forum.strataframe.net/FindPost14017.aspx</link><description>Sorry for the delay on this...I missed this post.&amp;nbsp; You could create a method to enumerate through the bounds controls.&amp;nbsp; To cycle through the collection, just do this.&amp;nbsp; You can then type of the "item" as a control to changed the editing state if you ned to.&lt;/P&gt;&lt;P&gt;[codesnippet]For Each Item As MicroFour.StrataFrame.UI.Windows.Forms.IBusinessBindable In Me.BoundControls&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Item.BindingField.Equals("MyFieldName", StringComparison.OrdinalIgnoreCase) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CType(Item, System.Windows.Forms.Control).Enabled = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;Next[/codesnippet]</description><pubDate>Tue, 05 Feb 2008 10:41:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Managing Control Editing State</title><link>http://forum.strataframe.net/FindPost13967.aspx</link><description>OK after a little more experimenting I found that the BindingEditable property is observed if the IgnoreManagedReadOnlyState for the control is set to True; so I can get the behaviour I'm looking for by setting both properties at the BO level.&lt;/P&gt;&lt;P&gt;Which leads to another question; my knowledge of system.predicate is pretty much zero:unsure:. How do I find the index of a bound control in the BoundControls collection given the field name?&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Sat, 02 Feb 2008 18:43:36 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item></channel></rss>