﻿<?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 / Issues  / Changing the value of a custom property programmatically, does not update the control. / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Sat, 22 Nov 2008 07:34:39 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/Topic13763-10-1.aspx</link><description>We help where we can :)</description><pubDate>Tue, 29 Jan 2008 11:43:29 GMT</pubDate><dc:creator>Ben Chase</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/Topic13763-10-1.aspx</link><description>Thank you guys. &lt;/P&gt;&lt;P&gt;It's really nice knowing 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/Topic13763-10-1.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.  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).  The .NET binding system will then find the event and add a handler to it to determine when to refresh the control.  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;    if (CustomPropertyChanged != null)&lt;BR&gt;    { 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;    get { return _customProperty; }&lt;BR&gt;    set &lt;BR&gt;    { &lt;BR&gt;        if (_customProperty != value)&lt;BR&gt;        {&lt;BR&gt;            _customProperty = value;&lt;BR&gt;            OnCustomPropertyChanged(EventArgs.Empty);&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}</description><pubDate>Mon, 28 Jan 2008 10:09:25 GMT</pubDate><dc:creator>Ben Chase</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/Topic13763-10-1.aspx</link><description>There are several options here, but the reason is that there is not a native Changed event managing the custom property.  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><item><title>Changing the value of a custom property programmatically, does not update the control.</title><link>http://forum.strataframe.net/Topic13763-10-1.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 property at run-time, with code &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>Mon, 28 Jan 2008 06:01:59 GMT</pubDate><dc:creator>George Nentidis</dc:creator></item></channel></rss>