Update BO

Update BO

Old forum URL: forums.lhotka.net/forums/t/3507.aspx


griff posted on Monday, September 10, 2007

Hi

I am using an editable root collection object (ClientEditList) and binding to a dataviewgrid via bindingsource

Me.BindingSource1.DataSource = BusinessObjects.ClientEditList.GetClientEditList

I would expect that when you move from row to row on the grid it fires an end edit/begin edit and so call  the update for the editable business object via the root collection.
Is my thinking correct - does anyone have any sample code demonstrating this (PT does not seem to have this exact scenario)

Thanks
Richard

jhw replied on Monday, September 10, 2007

When I move between rows I don't worry about those events. Because the grid is bound to the list, the properties are automatically updated. When I am done editing all the children, then I call List.save to update all the children in the db.

 

Heath

RockfordLhotka replied on Monday, September 10, 2007

CSLA supports two models:

  1. Using BusinessListBase as an editable root list, the user can edit the (editable child) items in the grid and then click a Save button to save all changes at once.
  2. Using EditableRootListBase as a dynamic list, the user can edit the (editable root) items in the grid, and as they leave each row the row's edits are automatically committed.

Copyright (c) Marimer LLC