﻿<?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 » WinForms (How do I?)  » Best way to make a bound control readonly?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 20 Sep 2026 15:16:50 GMT</lastBuildDate><ttl>20</ttl><item><title>Best way to make a bound control readonly?</title><link>http://forum.strataframe.net/FindPost11495.aspx</link><description>I have a business object with a bound field that I display in a form. The field value is populated in code (as a default value for the BO) so the user should not be able to change it although they do need to see it&lt;P&gt;By defult, when editing, the control becomes enabled. I have remedied this by implementing the EditingStateChanged event on the BO instance on my form and explicitly setting the UI control.Enabled to false&lt;/P&gt;&lt;P&gt;Question is: this works but is there a better way to do this?</description><pubDate>Mon, 17 Sep 2007 08:58:04 GMT</pubDate><dc:creator>thegwill</dc:creator></item><item><title>RE: Best way to make a bound control readonly?</title><link>http://forum.strataframe.net/FindPost11501.aspx</link><description>Larry is correct, you could do that.&amp;nbsp; Another option is to make the property read-only.&amp;nbsp; This will prevent the end-user from being able to modify that field as well.&amp;nbsp; If this is a field that is pulled from the schema, you can assign this through the BO Mapper (it is a check box).&amp;nbsp; If it is a custom property just assign it as read-only.&amp;nbsp; The simplest option though may be Larry's suggestion if this is going to be a one time thing.</description><pubDate>Mon, 17 Sep 2007 08:58:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Best way to make a bound control readonly?</title><link>http://forum.strataframe.net/FindPost11499.aspx</link><description>Thanks - I'll give it a try</description><pubDate>Mon, 17 Sep 2007 07:16:43 GMT</pubDate><dc:creator>thegwill</dc:creator></item><item><title>RE: Best way to make a bound control readonly?</title><link>http://forum.strataframe.net/FindPost11496.aspx</link><description>The easy way is to set the controls Enabled property = false and the IgnoreManagedReadOnlyState = true. This will prevent the control from being enabled when the bound object is being added or edited.&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Sun, 16 Sep 2007 13:29:38 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item></channel></rss>