This is a migrated thread and some comments may be shown as answers.

Event for propagating Model data to EditForm controls

2 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 11 Apr 2011, 05:01 PM
I tend to initiate the datasource controls in the codebehind without depending on the markup.  Mostly because you cannot debug it efficiently. 

My question is what is the best event handler or place to do this?  I am currently using the ItemDataBound event which I know is increasing redundancy considerably, doing it for each of the paged items.  That handler has event args that hooks into the EditForm so that the FindControl works. This is not only relevant for the generic fields of the model object in question but also for lookup controls, (states, countries etc.).

Thanks!
Reid

2 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 15 Apr 2011, 08:00 AM
Hello Reid,

The ItemDataBound event is the correct point in the page life cycle - furthermore, I don't think there arises any redundancy since those controls have to be set up at some point or another, be it during the Init stage (when in mark-up), be later in the OnLoad  when actually the ItemDataBound event occurs.

Regards,

Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Reid
Top achievements
Rank 2
answered on 15 Apr 2011, 01:37 PM
Ok, thanks for the reply.
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Tsvetoslav
Telerik team
Reid
Top achievements
Rank 2
Share this question
or