Events order for a Radgrid inside a asp Repeater

2 posts, 0 answers
  1. Gregory
    Gregory avatar
    25 posts
    Member since:
    Mar 2014

    Posted 05 Apr 2016 Link to this post


    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.

  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 08 Apr 2016 Link to this post


    See the help topic below that elaborates on the RadGrid's control's lifecycle:

    Maria Ilieva
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top