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

Nested RadGrid AjaxManager Link Button Loading panel not showing

1 Answer 90 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 28 Jan 2016, 11:57 PM

Hi All,

 

I Have a nested gridview with HierarchyLoadMode="Server Binding"  (think an Purchase Order / Lines).

Within the Lines grid view I have a link button in a template column:

    <telerik:GridTemplateColumn UniqueName="PO_Num" HeaderText="PO #" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="PO_Num">
                                    <ItemTemplate>
                                        <asp:LinkButton runat="server" ID="lbPO" CommandArgument='<%#Eval("PO_Num").ToString() %>' OnClick="lbPO_Click" Text='<%#Eval("PO_Num").ToString()%>' ToolTip="View invoices for this PO." />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>

 

When this button is clicked it pulls data and binds it to a completely separate grid.  

 My issue is with the loading panel.  When the link button first becomes visible, if I click on the link button the loading panel will not show, even though I'm dynamically adding the control to the rad ajax manager (I've tried on both the pre_render and ItemDataBound events).  The button still works as though it's ajaxed, but it's not being fired though the OnRequestStart.  If another control that is also ajaxed gets fired (say a dropdownlist on the page), the link button will then work as expected . . . going through the OnRequestStart and showing the loading panel.

 

 Looking for suggestions / work arounds.

 My Parent Grid databinding to the child grid:

protected void rgPurchaseOrder_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
        GridDataItem parentItem = e.Item as GridDataItem;
        RadGrid rgLines = parentItem.ChildItem.FindControl("rgLines") as RadGrid;
 
        if (!e.Item.Expanded)
        {
             
            rgLines.Visible = true;
            rgLines.Rebind();
 
            if (parentItem.ItemType == GridItemType.AlternatingItem)
                //e7ffe5
                parentItem.ChildItem.BackColor = System.Drawing.Color.FromArgb(231, 255, 229);
 
        }
        else
        {
            rgLines.Visible = false;
        }
        rgLines.MasterTableView.Rebind();
    }
 
 
}

 

 My Lines PreRender . . . 

protected void rgLines_PreRender(object sender, EventArgs e)
   {
       foreach (GridNestedViewItem item in rgPurchaseOrder.MasterTableView.GetItems(GridItemType.NestedView))
       {                  
           GridDataItem grandParentItem = (GridDataItem)item.ParentItem;
           RadGrid rgLines = grandParentItem.ChildItem.FindControl("rgLines") as RadGrid;
 
           if (rgLines!= null)
           {
               foreach (GridDataItem childItem in rgLines.MasterTableView.Items)
               {
  
                      LinkButton btn = (LinkButton)childItem["PO"].FindControl("lbPO");
    //wires up to an asp:panel . . . doesn't matter if I point at the rad grid directly or not, loading panel won't show.
    RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(btn, pnlInvoices, RadAjaxLoadingPanel2);
             }
 
 
 
          }
  
    }
 
 
}

 

aspx (just showing generic layout).

 

 <radgrid ID = "rgPurchaseOrder">

<master table view>

<columns>

  </Columns>
                            <NestedViewTemplate>

<radgrid ID="rgLines" >

</radgrid>

</master table view>

</radgrid>

 

 

<asp:panel id="pnlInvoices">

<radGrid id="rgInvoices">

</radGrid>

</asp:panel>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 02 Feb 2016, 03:58 PM
Hello,

Based on the provided description it is rather difficult to determine what exactly is causing the issue you are facing. Can you please share your full page markup and related code behind so that we can revise it locally and advise you further?

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Ajax
Asked by
Kyle
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or