Data is not save from editable Grid


Author
Message
Joseph-Carl Theodat
Joseph-Carl Theodat
StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)StrataFrame Beginner (29 reputation)
Group: Forum Members
Posts: 29, Visits: 79
Hi,

The following code is used to save the data from and editable grid which has a BusinessBindingsource.CurrentTable as the datasource.

private void tsSave_Click(object sender, EventArgs e)

{

bool ok = false;

MicroFour.StrataFrame.Data.SaveUndoResult saveStatus;

try

{

//Start the transaction

BusinessLayer.TransactionBegin("", System.Data.IsolationLevel.ReadCommitted);

saveStatus = propositionVersionBO.Save(true);

if (saveStatus == MicroFour.StrataFrame.Data.SaveUndoResult.Success)

{

if (propositionDetailBO.IsDirty)

if (propositionDetailBO.Save(true) == MicroFour.StrataFrame.Data.SaveUndoResult.Success)

ok = true;

}

}

catch (Exception)

{ // Not supposed to happen

// Write to Log entity

}

finally

{

if (ok)

{

// Everything succeeds, so it's time to commit

BusinessLayer.TransactionCommit("");

dgPropositionVersion.EditMode = DataGridViewEditMode.EditProgrammatically;

tsSave.Enabled = false;

tsUndo.Enabled = false;

tsEdit.Enabled = true;

}

else

{

// Error occurs, so rollback

BusinessLayer.TransactionRollback("");

// Keep business objects in edit mode

Edit();

}

}

}

For some reason the the after the commit, the primaryBO (not using grid) 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...

P.S

Sorry for the code indentation (cut & paste)


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search