Pavel Pavel - 1 month ago 16
Ajax Question

Telerik ASP.NET RadGrid is Ajax enabled but still does a postback

I am trying to make a RadGrid AJAX enabled so that when a user either sorts a column, or uses the "Paging" feature to go to the next page to see the next 10 rows in the grid, the page does not do a PostBack. However, even with the below config, it is still doing a page PostBack. Any advice is greatly appreciated.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

<div style="padding-left: 20px;">
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
OnColumnCreated="RadGrid1_ColumnCreated" AllowSorting="True" AllowPaging="True" CellSpacing="-1"
GridLines="Both" Skin="Black">
</telerik:RadGrid>
</div>

Answer

Per Telerik Support, the script manager must be the first control on the form:

<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <link href="styles.css" rel="Stylesheet" type="text/css" />
</head>

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadAjaxManager runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

You will also notice that I put the RadStyleSheetManager in the section so it will render the elements there, where they belong.