<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Last Edited Field</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Last Edited Field</description>
  <pubDate>Wed, 13 May 2026 19:25:43 -700</pubDate>
  <lastBuildDate>Mon, 22 Sep 2008 15:22:05 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=946</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Last Edited Field :          From a two-year...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=946&amp;PID=3423#3423</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 946<br /><strong>Posted:</strong> 22-Sep-2008 at 3:22pm<br /><br /><TABLE style="WIDTH: 100%; white: " cellSpacing=0 cellPadding=0 width="100%" ="Ms&#111;normalTable"><T><T><TR><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; PADDING-TOP: 3.75pt; ffe9b9: " ="#ffe9b9"><DIV><TABLE cellSpacing=0 cellPadding=0 ="Ms&#111;normalTable"><T><T><TR><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; WIDTH: 100%; PADDING-TOP: 3.75pt" width="100%"><B><FONT face=Verdana color=black size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><DIV>From a two-year old Tech Tip from Ward Bell</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Forcing databinding completion</SPAN></FONT></B><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"> <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></SPAN></FONT></DIV><P><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">Some of you may have noticed that clicking on the Save button in the toolstripmenu has different behavior than clicking on a Save button in the form. Editing the property via the textbox and clicking on the Save button in the form saves the edited value. Doing the same thing with the textbox and clicking on the Save button on the toolstripmenu does not.<BR><BR>To fix the behavior of the Save button on the toolstrip menu, there is something you must do to effect the equivalent of a loss of focus when someone clicks the "Save" button in a tool strip.<BR><BR>When I make a change in a textbox and click the Save button in the toolstrip, the textbox does NOT lose focus. This is because the action in the toolbar may be something that should affect the way the text looks (bold it maybe) rather than force the databinding to write through to the data object.<BR><BR>Unfortunately, the Save button's action will save the entity WITHOUT picking up the changed text unless we do something.<BR><BR>That "something" is called "this.validate():" (in C#) or "Me.Validate()" (in VB.Net). <BR><BR>The "this" or "Me" in this case is the Form or UserControl that holds the ToolStrip.<O:P></O:P></SPAN></FONT></P></TD></TR></T></T></TABLE></DIV><P ="Ms&#111;normal"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><O:P></O:P></SPAN></FONT></P></TD><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; PADDING-TOP: 3.75pt; ffd680: " ="#ffd680"><P ="Ms&#111;normal"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<O:P></O:P></SPAN></FONT></P></TD></TR><TR><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; PADDING-TOP: 3.75pt; ffd680: " ="#ffd680"><P ="Ms&#111;normal"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<O:P></O:P></SPAN></FONT></P></TD><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; PADDING-TOP: 3.75pt"><DIV><TABLE cellSpacing=0 cellPadding=0 ="Ms&#111;normalTable"><T><T><TR><TD style="PADDING-RIGHT: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-BOTTOM: 3.75pt; WIDTH: 100%; PADDING-TOP: 3.75pt" width="100%"><P ="Ms&#111;normal"><B><FONT face=Verdana color=black size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">Sample shown below:</SPAN></FONT></B><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"> <O:P></O:P></SPAN></FONT></P><P><strong><B><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">C#:</SPAN></FONT></B></strong><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><O:P></O:P></SPAN></FONT></P><P><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">void SaveAllHandler(object sender, EventArgs e) {<BR>&nbsp;this.Validate(); </SPAN></FONT><I><FONT face=Verdana color=#006633 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #006633; FONT-STYLE: italic; FONT-FAMILY: Verdana"><BR><EM><I><FONT face=Verdana><SPAN style="FONT-FAMILY: Verdana">// Forces current control to perform databinding as if it lost focus.</SPAN></FONT></I></EM></SPAN></FONT></I><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> <BR>&nbsp;try { <BR></SPAN></FONT><EM><I><FONT face=Verdana color=#006633 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #006633; FONT-FAMILY: Verdana">// Save everything</SPAN></FONT></I></EM><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><BR>&nbsp;SaveResult sr = PersistenceManager.DefaultManager.SaveChanges();</SPAN></FONT><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><O:P></O:P></SPAN></FONT></P><P><strong><B><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">VB.NET:</SPAN></FONT></B></strong><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><O:P></O:P></SPAN></FONT></P><P><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Sub SaveAllHandler(sender As object, e As EventArgs) {<BR>&nbsp;Me.Validate() </SPAN></FONT><I><FONT face=Verdana color=#006633 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #006633; FONT-STYLE: italic; FONT-FAMILY: Verdana"><BR><EM><I><FONT face=Verdana><SPAN style="FONT-FAMILY: Verdana">' Forces current control to perform databinding as if it lost focus.</SPAN></FONT></I></EM></SPAN></FONT></I><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> <BR>&nbsp;try { <BR></SPAN></FONT><EM><I><FONT face=Verdana color=#006633 size=2><SPAN style="FONT-SIZE: 10pt; COLOR: #006633; FONT-FAMILY: Verdana">' Save everything</SPAN></FONT></I></EM><FONT face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><BR>&nbsp;Dim sr As SaveResult = PersistenceManager.DefaultManager.SaveChanges()</SPAN></FONT><FONT face=Verdana color=black size=2><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><O:P></O:P></SPAN></FONT></P></TD></TR></T></T></TABLE></DIV></TD></TR></T></T></TABLE><span style="font-size:10px"><br /><br />Edited by davidklitzke - 22-Sep-2008 at 3:23pm</span>]]>
   </description>
   <pubDate>Mon, 22 Sep 2008 15:22:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=946&amp;PID=3423#3423</guid>
  </item> 
  <item>
   <title>Last Edited Field : I have a form that has fields...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=946&amp;PID=3420#3420</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 946<br /><strong>Posted:</strong> 22-Sep-2008 at 11:33am<br /><br />I have a form that has fields (textfields, checkboxes, comb boxes etc) hooked up to a Control Binding Manager.&nbsp; When the user clicks a toolbar button 'Save and Close' the form calls the Save routine of the controller class.<DIV>&nbsp;</DIV><DIV>Is there any way to tell what was the last edited field on the form at the time the 'Save' button is called?&nbsp; I would like to take that field out of edit mode programmatically.&nbsp; Right now, I have the client move off the last edited field but I hate that.</DIV><DIV>&nbsp;</DIV><DIV>If the answer is no, can anyone show me some code to loop through the form and move each field out of edit mode?</DIV><DIV>&nbsp;</DIV><DIV>Bill</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 22 Sep 2008 11:33:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=946&amp;PID=3420#3420</guid>
  </item> 
 </channel>
</rss>