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

Rebinding a grid in NestedViewTemplate

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard Boarman
Top achievements
Rank 1
Richard Boarman asked on 17 Nov 2010, 10:08 PM
I have a RadGrid (RadGrid1) that has a nestedViewTemplate. In this NestedViewTemplate, another grid (RadGrid2) is loaded.
RadGrid2 has an imagebutton in each row that opens a RadWindow, where the user can make modifcations to the row in RadGrid2.
When the RadWindow is closed (OnClientClose="refreshGrid" ), this function is run
function refreshGrid() {
        var args = null;
        args = document.getElementById("inpHidden").value;
        if (args) {
            var mgr = $find("<%= RadAjaxManager1.ClientID %>");
            if (mgr) {
                mgr.ajaxRequest(args);
            }
        }
    }

The RadAjaxManager1_AjaxRequest method rebinds the grid in the NestedViewTemplate without reloading the main grid RadGrid1. This is the desired behavior and works fine. However, if I click on the image button again, the function can no longer find a reference to RadAjaxManager1, which is on the control that holds the Main grid
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
            </UpdatedControls>
        </telerik:AjaxSetting
        <telerik:AjaxSetting AjaxControlID="RadGrid2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
            </UpdatedControls>
        </telerik:AjaxSetting
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxPanel ID="RadAjaxPanel4" runat="server" Width="100%" LoadingPanelID="RadAjaxLoadingPanel4">
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel4" runat="server"">
telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="RadGrid1" ....

Any idea why the manager can no longer be found?

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 23 Nov 2010, 08:28 AM
Hi Richard,

Does using a bit different syntax, namely:

C#
var mgr = $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>");
or
VB.NET
var mgr = $find("<%= RadAjaxManager.GetCurrent(Me).ClientID %>");

makes a difference? Also it will be helpful if you post your aspx markup code with the related code behind.

Looking forward for your reply.

Best wishes,
Radoslav
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Richard Boarman
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or