﻿<?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 » Issues  » Changing the value of a custom property programmatically, does not update the control.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 17 May 2026 13:28:58 GMT</lastBuildDate><ttl>20</ttl><item><title>Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/FindPost13763.aspx</link><description>Hi there. &lt;/P&gt;&lt;P&gt;I have a string custom property in a BO which I bind to a MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit. &lt;/P&gt;&lt;P&gt;When setting the value of the&amp;nbsp;property at run-time, with code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;Customer.CustomProperty = "SomeValue";&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;the control does not show the changed value. Is it something I'm not doing right? BindingUpdateMode and ControlSourceUpdateMode are both OnPropertyChanged.&lt;/P&gt;&lt;P&gt;I have tried this with your DevEx sample application, and does not work there either.</description><pubDate>Tue, 29 Jan 2008 11:43:29 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/FindPost13830.aspx</link><description>We help where we can :)</description><pubDate>Tue, 29 Jan 2008 11:43:29 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/FindPost13828.aspx</link><description>Thank you guys. &lt;/P&gt;&lt;P&gt;It's really nice knowing&amp;nbsp;I can count on you...</description><pubDate>Tue, 29 Jan 2008 10:42:52 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item><item><title>RE: Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/FindPost13770.aspx</link><description>If the custom property does not have a backing field within the underlying DataTable, you will need to raise a "Changed" event when the property is set.&amp;nbsp; The event needs to be an EventHandler and needs to be named PropertyNameChanged where "PropertyName" is the name of your property (i.e. TextChanged on a textbox).&amp;nbsp; The .NET binding system will then find the event and add a handler to it to determine when to refresh the control.&amp;nbsp; So:&lt;/P&gt;&lt;P&gt;public event EventHandler CustomPropertyChanged;&lt;BR&gt;&lt;BR&gt;protected virtual void OnCustomPropertyChanged(EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CustomPropertyChanged != null)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { CustomPropertyChanged(e); }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;[all of the necessary attributes]&lt;BR&gt;public string CustomProperty&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _customProperty; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_customProperty != value)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _customProperty = value;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OnCustomPropertyChanged(EventArgs.Empty);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}</description><pubDate>Mon, 28 Jan 2008 10:09:25 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/FindPost13769.aspx</link><description>There are several options here, but the reason is that there is not a native Changed event managing the custom property.&amp;nbsp; However, you can do several things, you can create a custom event (propnameChanged as EventHandler) that is raised when the value is changed....or just call the Refresh method on the BO:&lt;/P&gt;&lt;P&gt;[codesnippet]Customers.Refresh("MyCustomFieldName")[/codesnippet]&lt;/P&gt;&lt;P&gt;or within the property&lt;/P&gt;&lt;P&gt;[codesnippet]Me.Refresh("MyCustomFieldName")[/codesnippet]</description><pubDate>Mon, 28 Jan 2008 10:04:57 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>