Edit mode in GridView ASP.NET 2.0

Posts   
 
    
billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 08-Aug-2007 16:57:45   

I've built a web application with LLBLGen Pro 2.0 sometime ago. The customer has come back and they want in place editing on the GridView. In my search of the forum and help, I see reference to a LLBLGenProDataSource2. It seems like a lot of work for me to go back and change all of these grids to work with this data source. Right now, I just bind them to EntityCollections. Is there a way to make in-place editing of grids work right w/ just an EntityCollection?

Thank you for the help.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Aug-2007 17:29:31   

Yes, is possible, but you have to do more work in opposite to use a LLBLGenProDataSource2.

If you use EntityCollections, you need to add logic to Fetch (at Page_Load?) and Persist to DB (catch GridView's events and put logic there to persist changes to DB, or add a global button to save everything).

David Elizondo | LLBLGen Support Team
billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 08-Aug-2007 17:37:50   

Thanks for the response. That's the thing, all of that work is already done. Anyway, shortly after posting I think I found my solution (although I'm not out of the woods yet).

I need to handle the RowEditing event and inside of that event I have to do things in this order.


    GridViewIngredient.EditIndex = e.NewEditIndex
    PopulateIngredientGrid(DropDownListSource.SelectedValue)

Where PopulateIngredientGrid() builds the EntityCollection and then calls GridViewIngredient.DataBind()

daelmo wrote:

Yes, is possible, but you have to do more work in opposite to use a LLBLGenProDataSource2.

If you use EntityCollections, you need to add logic to Fetch (at Page_Load?) and Persist to DB (catch GridView's events and put logic there to persist changes to DB, or add a global button to save everything).