Win forms grid databinding

Posts   
 
    
cheng
User
Posts: 8
Joined: 05-Apr-2009
# Posted on: 20-Apr-2009 17:45:19   

Hi,

I've used LLBLGen's datasource controls on webforms and they work great.

I'm doing a Win forms project now (VS2008, .NET 3.5, LLBLGen 2.6, DevExpress XtraGrid) and I read the recommendation to bind the grid to a BindingSource with the EntityCollection as the BindingSource's data source.

I'd like to know the best way to persist grid changes. I allow new row insertion and editing in the grid, and I found that the changes are made to the EntityCollection but not persisted in the DB.

I feel like I'm missing something disappointed May I know how best or where I should invoke SaveMulti(true) on the EntityCollection? I can't think of any value in letting changes sit in the EntityCollection without persisting immediately.

Thanks, Cheng

Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 20-Apr-2009 21:51:38   

I guess it depends on what you want. If you have a save button, then Save the collection then, otherwise save it on a different event.

cheng
User
Posts: 8
Joined: 05-Apr-2009
# Posted on: 21-Apr-2009 15:58:32   

Thanks Seth. Will use an event.