Telerik RadGrid stopped populating data after I removed RadScriptManager

Viewed 19

I have a Telerik RadGrid and a "Search" button to search for a specific data.

My page used to have RadScriptManager. Now RadScriptManager is placed on Master page and I had to remove it from my page.

After I removed it, the grid on my page stopped being repopulated

Here is some part of the code:

   <%-- <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />--%>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ajaxControl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="btnSearch"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadButton RenderMode="Lightweight" runat="server" Text="Search" ID="btnSearch" OnClick="btnSearch_Click"></telerik:RadButton>

<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
      <telerik:RadGrid 
 
  ....Here come a Grid Code....

        </telerik:RadGrid>
</telerik:RadAjaxPanel>

What am I missing here?

1 Answers

I fixed the problem.

I used the wrong control ids for AjaxUpdatedControl and AjaxSetting elements.

I had to change it to be as follows:

<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="btnSearch">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="GridID"></telerik:AjaxUpdatedControl>
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

So, basically: AjaxSetting control's id should've been id of my button AjaxUpdatedControl control's id should've been id of my grid

Hope that helps someone with the same problem

Related