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

AjaxLoadingPanel appearing for the first button ONLY within a repeater

1 Answer 121 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mayuresh Sawardekar
Top achievements
Rank 1
Mayuresh Sawardekar asked on 04 Feb 2014, 07:54 PM
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"}]} 















1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Feb 2014, 09:48 AM
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.
Tags
Ajax
Asked by
Mayuresh Sawardekar
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or