AjaxLoadingPanel appearing for the first button ONLY within a repeater

2 posts, 0 answers
  1. Mayuresh Sawardekar
    Mayuresh Sawardekar avatar
    4 posts
    Member since:
    Jan 2010

    Posted 04 Feb 2014 Link to this post

    I have a page loading a usercontrol. The User control has a repeater with a link button in it. On every click of the link button I want to reload a RadGrid on the page.  While loading the RadGrid I am showing a RadAjaxLoadingPanel. 

    Currently the RadAjaxLoadingPanel appears only for the click event of the first link button of the repeater. For the other link buttons, it does a full postback. In the repeater's data bound event  I have the code to wireup the RadAjaxLoadingPanel to show for every item's link button control.

    protected void RptLetterIndexItemDataBound(object sender, RepeaterItemEventArgs e)
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    var btn = e.Item.FindControl("lnkLetter") as LinkButton;
                    AjaxManagerProxy1.AjaxSettings.AddAjaxSetting(btn, RadGrid2, RadAjaxLoadingPanel2);
                }            
            }

    However when i see the source of the page , I see that the event is only hooked up for the first repeater item. How can I bind the ajaxloadingpanel for every link button in the repeater ?

    {InitControlID : "ctl00_ContentMain_SkillsSearchCtl_rptLetterIndex_ctl00_lnkLetter",UpdatedControls : [{ControlID:"ctl00_ContentMain_SkillsSearchCtl_RadGrid2",PanelID:"ctl00_ContentMain_SkillsSearchCtl_RadAjaxLoadingPanel2"}]} 















  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 07 Feb 2014 Link to this post

    Hi Mayuresh,

    Try adding the ajax setting on PageLoad like this:
    protected void Page_Load(object sender, EventArgs e)
        {
            foreach (RepeaterItem item in RptLetterIndex.Items)
            {
                LinkButton btn = (LinkButton )item.FindControl("lnkLetter");
                RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(btn, RadGrid2, RadAjaxLoadingPanel2);     
            
        }

    and verify if this works for you.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top