﻿<?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?)  » Data is not save from editable Grid</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 10 Sep 2026 08:17:14 GMT</lastBuildDate><ttl>20</ttl><item><title>Data is not save from editable Grid</title><link>http://forum.strataframe.net/FindPost8997.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;The following code is used to save the data from and editable grid which has a BusinessBindingsource.CurrentTable as the datasource.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; tsSave_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; ok = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;MicroFour.StrataFrame.Data.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SaveUndoResult&lt;/FONT&gt;&lt;FONT size=2&gt; saveStatus;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;try&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//Start the transaction&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessLayer&lt;/FONT&gt;&lt;FONT size=2&gt;.TransactionBegin(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, System.Data.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;IsolationLevel&lt;/FONT&gt;&lt;FONT size=2&gt;.ReadCommitted);&lt;/P&gt;&lt;P&gt;saveStatus = propositionVersionBO.Save(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (saveStatus == MicroFour.StrataFrame.Data.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SaveUndoResult&lt;/FONT&gt;&lt;FONT size=2&gt;.Success)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (propositionDetailBO.IsDirty)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (propositionDetailBO.Save(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;) == MicroFour.StrataFrame.Data.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SaveUndoResult&lt;/FONT&gt;&lt;FONT size=2&gt;.Success)&lt;/P&gt;&lt;P&gt;ok = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;catch&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Exception&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;{ &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Not supposed to happen&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Write to Log entity&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;finally&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (ok)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Everything succeeds, so it's time to commit&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessLayer&lt;/FONT&gt;&lt;FONT size=2&gt;.TransactionCommit(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;dgPropositionVersion.EditMode = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DataGridViewEditMode&lt;/FONT&gt;&lt;FONT size=2&gt;.EditProgrammatically;&lt;/P&gt;&lt;P&gt;tsSave.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;tsUndo.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;tsEdit.Enabled = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Error occurs, so rollback &lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessLayer&lt;/FONT&gt;&lt;FONT size=2&gt;.TransactionRollback(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;// Keep business objects in edit mode&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;Edit();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;For some reason the the after the commit, the primaryBO (not using grid)&amp;nbsp;is updated but the other one (propositionDetailBO using grid) is not. What's wrong? I cant see the grid has the previous values after the commit... Without having the devexpress grid, is it possible to have an editable grid from the 2.0 framework to work with the BO?... If not do you have any plan to resolve the issue...&lt;/P&gt;&lt;P&gt;P.S&lt;/P&gt;&lt;P&gt;Sorry for the code indentation (cut &amp;amp; paste)&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 24 May 2007 09:12:51 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: Data is not save from editable Grid</title><link>http://forum.strataframe.net/FindPost9027.aspx</link><description>Hehe, yes, it is possible to save the data from the grid.&amp;nbsp; But like you said in your post above, most grids make you edit the editing cell to comitt the data back to the data source.</description><pubDate>Thu, 24 May 2007 09:12:51 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Data is not save from editable Grid</title><link>http://forum.strataframe.net/FindPost9014.aspx</link><description>My code works! I forgot to exit the cell of the grid in order to accept the changes:D&lt;/P&gt;&lt;P&gt;Hope that my code can help...</description><pubDate>Wed, 23 May 2007 16:05:45 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: Data is not save from editable Grid</title><link>http://forum.strataframe.net/FindPost9013.aspx</link><description>it will simpler to know if it is possible to save date from an editable grid using the BO. If yes, how?</description><pubDate>Wed, 23 May 2007 15:21:17 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: Data is not save from editable Grid</title><link>http://forum.strataframe.net/FindPost9007.aspx</link><description>Does the propositionDetailBO still think it's dirty after the save (propositionDetailBO.IsDirty == true)?&amp;nbsp; And how exactly do you have the DataSource on the grid configured?&amp;nbsp; Did you set the CurrentDataTable as the data source directly, or did you set the BusinessBindingSource as the data source directly and set the BusinessObject property on the BBS to the propositionDetailBO?</description><pubDate>Wed, 23 May 2007 14:26:44 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>