LLBLGenProDataSource2 OnDataBinding

Posts   
 
    
spodgod
User
Posts: 14
Joined: 20-Sep-2007
# Posted on: 27-Mar-2009 17:17:34   

Hi

I'd like to handle an event before the LLBLGenProDataSource2 carries out its databinding, but I can't find the appropriate event handler.

Neither the PerformSelect nor Databinding events fire, and I can't see any others that are suitable. I know I can turn PerformSelect event on by turning LivePersistance off, but my understanding is that I then have to intercept and provide all the binding logic myself and I don't want to do that. I'm a slave to declarative programming smile

I'm doing this to set up the FilterToUse property, so if I can't use a prebinding event but there's another way to do this I'd be grateful to know of it. I can't do it at form load as it depends on other control parameters which have not themselves bound at form load time. The filters are non-entity fields (which is why I don't just add them to the datasource declaratively).

LLBLGen Pro 2.6 Final, ASPxGridView 8.2.4, ASP.NET 2, Adapter, SQL Server 2005, runtime library version 2.6.8.1114

Thanks

Rich

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Mar-2009 21:10:03   

What databinding control are you using? You could, for instace, catch the FormView.ItemCreated event to manipulate the filter of the LLBLGenProDataSource.

If you want to do something with the data fetched, you could use ElementsFetched event of the LLBLGenProDataSource.

David Elizondo | LLBLGen Support Team
spodgod
User
Posts: 14
Joined: 20-Sep-2007
# Posted on: 22-Apr-2009 14:05:32   

I'm using DevExpress' ASPxGridView. The problem is that bizarrely (or should that be infuriatingly) the ASPxGridView.OnDataBinding event seems to fire (correctly) before it binds to the datasource on a postback or callback, but on initial page load it fires after it binds to the datasource.

I'm guessing this is a fault with the ASPxGridView, but getting support out of DevExpress is like pulling teeth so I thought I'd check with you first for any possible workaround.

It looks however from your answer that there isn't an event on the LLBLGenProDataSource that fires before binding (unless I turn off LivePersistance which as I've said I don't particularly want to do). So I know this is a low priority, but can I register a change request to add a BeforeDatabinding event to the LLBLGenProDataSource controls for whenever the next release is please?

Ta

Rich

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 22-Apr-2009 15:07:36   

I know I can turn PerformSelect event on by turning LivePersistance off, but my understanding is that I then have to intercept and provide all the binding logic myself and I don't want to do that. I'm a slave to declarative programming

Not true, setting LivePersistence off, will force you to handle the database interactions yourself but not the databinding.

Please check Example using Perform Event handlers