﻿<?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?)  » How to 'Auto Save' after an edit and scrolling to a new row</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 19 Sep 2026 20:35:58 GMT</lastBuildDate><ttl>20</ttl><item><title>How to 'Auto Save' after an edit and scrolling to a new row</title><link>http://forum.strataframe.net/FindPost7293.aspx</link><description>&lt;BR&gt;I'm having problems working my way through this issue and I was hoping you could provide a code snippet/advice to show me how I handling this function correctly. I'm using a DevExpress grid and want to auto save any changes as the user moves between rows. To do this I have the following code in the BO:&lt;/P&gt;&lt;P&gt;Private Sub boATT_Navigating(ByVal e As MicroFour.StrataFrame.Business.NavigatingEventArgs) Handles Me.Navigating&lt;BR&gt;&amp;nbsp;&amp;nbsp; If Me.IsDirty Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Save()&lt;BR&gt;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;This works fine until I add a new record. Then, for some reason, IsDirty is True (when it shouldn't be) and Save executes. The problem is boATT_Navigating keeps getting fired and, because IsDirty is still true, Save executes again and eventually I get a stack overflow on the Save.&lt;/P&gt;&lt;P&gt;I tried (and failed) to find a property that tells me&amp;nbsp;I'm entering 'create a new record' mode. I thought I could add that test to the IsDirty so I don't execute the Save when starting the create&amp;nbsp;new record&amp;nbsp;cycle.&lt;/P&gt;&lt;P&gt;I'm not setting any default values so that isn't the cause if IsDirty being true.&lt;/P&gt;&lt;P&gt;Even though Save is firing no SQL update code is being executed.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Tue, 20 Mar 2007 10:37:10 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: How to 'Auto Save' after an edit and scrolling to a new row</title><link>http://forum.strataframe.net/FindPost7601.aspx</link><description>Testing, please ignore :)</description><pubDate>Tue, 20 Mar 2007 10:37:10 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to 'Auto Save' after an edit and scrolling to a new row</title><link>http://forum.strataframe.net/FindPost7295.aspx</link><description>[quote]Then, for some reason, IsDirty is True (when it shouldn't be) and Save executes. [/quote]&lt;/P&gt;&lt;P&gt;This is by design and is correct.&amp;nbsp; IsDirty actually looks to see if there are any records within the CurrentDataTable that have been modified, deleted, or added.&amp;nbsp; So IsDirty is indicating that you have added a record.&lt;/P&gt;&lt;P&gt;I think that you would be better of doing one of two things.&amp;nbsp; Since you are using a grid, and grids are a different animal than any other type of control due to the massive amount of code behind a grid, events may behave slightly different.&amp;nbsp; You should try capturing an event on the grid that indicates that the row has already been navigated...or, try placing your code in the Navigated event rather than the Navigating.&amp;nbsp; This is why your Add behaves the way it does....the navigation to the new row has not yet taken place.</description><pubDate>Sun, 04 Mar 2007 21:26:10 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>