Loading LLBLDataSource before Page_Load in ASP.NET

Posts   
 
    
amitjindal
User
Posts: 34
Joined: 03-Jun-2010
# Posted on: 02-Sep-2010 09:18:53   

Hello,

We are running into a sort of problem. Let's say for example, we have a page with various controls including some combo boxes like Employee page with department and manager combo boxes.

We have bound the combo boxes via LLBL Data Source. When we come to page for editing an employee, on Page_Load event we try to fill the values in all controls from existing values including selecting existing department and manager. But on page_load the combo boxes are not yet filled.

The combo boxes are DevExpress ASP.net combo boxes.

So is it by design or is there a better way to do this?

Thanks Amit

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Sep-2010 09:42:57   

I would have used a FormView to edit the Employee info, and thus it should be bound to the Employee entity, and then the Departement DropDownList should have its SelectedValue bound to the Employee's DepartementId.

But if you want to do it your way, then try the Page_PreRender event, or the DropDownList dataBound event.