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

Events order for a Radgrid inside a asp Repeater

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 2
Gregory asked on 05 Apr 2016, 04:34 PM

Hello,

I have a RadGrid inside a Asp repeater. 0 to 15 grids are built depending on the user preferences through the repeater. I placed a Response.Write([Method Name]) in the events and this is one I obtained for 2 grid containing 5 rows each. The repeater Repeater.DataBind() is called when the user clicks on a button.

Button_Click begin
Repeater_DataBinding begin
Repeater_DataBinding end
    RadGrid_NeedDataSource begin
    RadGrid_NeedDataSource end
        RadGrid_ItemDataBound begin
        RadGrid_ItemDataBound end     (occured 24 times)
Repeater_ItemDataBound begin
        RadGrid_ItemDataBound begin
        RadGrid_ItemDataBound end     (occured 12 times)
Repeater_ItemDataBound end
    RadGrid_NeedDataSource begin
    RadGrid_NeedDataSource end     (occured 24 times)
Repeater_ItemDataBound begin
        RadGrid_ItemDataBound begin
        RadGrid_ItemDataBound end     (occured 12times)
Repeater_ItemDataBound end
Button_Click end

I am not sure why each grid runs ItemDataBound twice that many times (24 times = (5 rows + header) x 4 and then 12 times = (5 rows + header) x 2).

I would also expect RadGrid_NeedDataSource to be inside the Repeater_ItemDataBound scope.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 08 Apr 2016, 12:55 PM
Hello,

See the help topic below that elaborates on the RadGrid's control's lifecycle:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/control-lifecycle/event-sequence

Regards,
Maria Ilieva
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
Gregory
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or