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

$find('<%= RadGrid.ClientID %>') returns null after AJAX callback

1 Answer 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Łukasz
Top achievements
Rank 1
Łukasz asked on 16 Jul 2012, 10:46 AM
I am using RadGrid on my page with AJAX functionality. After performing AJAX callback, it stops working and using almost every functionality returns error (4.jpg, from Firebug):

$find("ctl00_placeholderBody_ctl04_ListControl_RadGrid_ctl00") is null

When I looked at DOM, I noticed RadGrid object has weird name ("null", 3.jpg).

How is this possible? This is part of my view:

<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadGrid">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadGrid" LoadingPanelID="RadAjaxLoadingPanel" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel Runat="server" Skin="Default" ID="RadAjaxLoadingPanel">
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="RadGrid" runat="server" AutoGenerateColumns="False" AllowPaging="True"
    AllowSorting="True" PageSize="10" AllowFilteringByColumn="true" AllowCustomPaging="True" ClientIDMode="AutoID">
    <mastertableview ClientIDMode="AutoID">
    </mastertableview>
</telerik:RadGrid>



1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 18 Jul 2012, 02:02 PM
Hello Ɓukasz,

Everything in the provided code seems all right except the IDs of the controls. Generally, we highly suggest to avoid assigning an ID equal to the exact name of the control itself.

I have created a sample RadGrid web site ajaxified with RadAjaxManager. On my side everything works as expected. Please check out the attached application and try to distinguish the crucial differences between our projects.

Also please note that  if you are using a complex scenario like WebUserControls or Master/ContentPages, we recommend you to place RadAjaxManager instance on the main/master page and add a proxy control to the user control/content page as described in the following help topic:
RadAjax and MasterPage

You could also refer to various grid demos where RadAjax is implemented to get a practical idea of ajaxifying controls.

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Łukasz
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or