Forcing LLBLGenProDataSource2 to update

Posts   
 
    
neilx
User
Posts: 267
Joined: 02-Nov-2007
# Posted on: 28-Mar-2011 23:08:05   

LLB v2.6 2.6.10.809 (SD.LLBLGen.Pro.LinqSupportClasses.NET35.dll) 2.6.10.930 (SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll) 2.6.10.917 (SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll) DotNet 4.0 vs2010 project

I have a DevExpress ASPxGridView working well with an LLB DS. It is all automatic with LivePersistence = false and the PerformSelect handler getting the EntityCollection and the PerformWork handler commiting the Uow. All I need to do in the grid is allow the user to click the UpdateEdit button. Great.

As this view will have hundreds of controls to update, I want to eliminate the UpdateEdit button and replace it with OnChange handlers for each editable control for a smoother user experience. This is easy with the clientside event aspxGVUpdateEdit('grid').

When UpdateEdit() is executed, it updates the data source then returns the user interface to data mode, closing the EditForm. This is a pain as I have several controls for the user to update in the EditForm. So by eliminating a single button click, I have now added a click to reopen the EditForm after every control is changed. Not so hot.

I can bypass the UpdateEdit() method altogether, and in a callback handler tell the LLB DS to update using event parameters. But then I lose the nice abstracted e.Uow.Commit(adapter,true) statement that means I don't care what has been changed as LLB DS has managed it for me. Reason to buy LLBsimple_smile

So, if I don't use the DevExpress UpdateEdit() method as it annoyingly does two things (updates then changes the user's viewing mode) is it possible for me in some handler to update the LLB DS without having to work out what fields were changed. I have searched the Intellisense but can't spot a way to do this yet. I wondered about doing a fake update and see if that creates the Uow object and fires the PerformWork event, but I suspect that won't include the changes the user made unless I do them manually.

Any advice on this is gratefully received. (I have also asked the DevExpress support center)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-Mar-2011 06:42:09   

Hi neilx,

Could you please elaborate a flow example of what exactly are you looking for? If I understand you correctly, you want to get ride of the Update button of the grid, let the user to edit every field control and automatically update the datasource/db, right?

You must think of LLBLGenProDatasource as an implementation of ObjectDataSource that works with Entities. So, every thing you can do with ODS, you can do with LLBLGenProDataSource. So at this point.

David Elizondo | LLBLGen Support Team
neilx
User
Posts: 267
Joined: 02-Nov-2007
# Posted on: 29-Mar-2011 08:06:36   

daelmo wrote:

Hi neilx,

Could you please elaborate a flow example of what exactly are you looking for? If I understand you correctly, you want to get ride of the Update button of the grid, let the user to edit every field control and automatically update the datasource/db, right?

Correct. It is an auditing application for industrial and commercial facilities.

The user sees a paged listing of hundreds of items (laws). Each item has a details row grid of 5 to 30 related items (requirements for that law). They need to work through each item and its requirements and answer questions and make comments. That is potentially thousands of items to be updated over the course of a several day audit. If they have to press update after every row's updating, then this will add significant overhead to their auditing task.

Using the ASPxGridView in conjunction with LLB's datasource makes the functionality of updating numerous things a piece of cake. This works and I can put up a demo later today if that helps.

To eliminate the extra click per row I need to: a update every time a control value is changed, or b update once per row (with its details grid included), or c update once per page

The whole application is commonly called a questionaire, but it has a lot of backend processing to do when data is changed. Option a is the best as it will allow any changes that can be inferred in the details row to be managed immediately. For example, if a law isn't relevant, then previous requirements answer need to be checked and maybe adjusted accordingly. (Performance seems acceptable on current tests)

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Mar-2011 10:06:42   

The MS GridView has a method called UpdateRow() which accepts a rowIndex. This should update the row in the dataSource. You should look for a similar method in the AspxGridView.