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

Grid with radwindow after second bind cannot be found

1 Answer 35 Views
Window
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 27 May 2012, 05:14 AM
Hi,
I have a radgrid with edit links to open radwindow to update a record.
It is a modified copy of your code Edit dialog for RadGrid
The differences are:
My Rad Grid is on UserControl
I'm using LinqDataSource for selecting record.

On the "Update", call is made to refreshGrid function call ajaxRequest to rebind the grid.

This works the first time, the second time I cannot open the RadWindow.
The error is "grid is null" in the following function

        function ShowEditForm(id, rowIndex) {
            var grid = $find("<%= RadGrid1.ClientID %>");
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
            grid.get_masterTableView().selectItem(rowControl, true);

            window.radopen("../FileStorage/Pages/ClientMnt.aspx?ClientId=" + id, "ClientMntDialog");
            return false;
        }


Anyone any ideas?

Thanks
Peter

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 May 2012, 04:32 PM
Hi Peter,

Do you change the ID of your RadGrid in the server or in case it is created dynamically can you confirm that it has the same ID each time? Is the function in the same user control? Is the user control added via AJAX or not? I am asking all these questions, because there are limitations in the MS AJAX framework when JavaScript code inside a user control is loaded dynamically and if it is not recreated properly.

This error is not related to the RadWindow, but to the way you reference the RadGrid and a JavaScript error breaks the execution of the sctipt which is why your RadWindow does not open.

If you cannot trace where the change of IDs occurs I advise that you open a support ticket and send us a simple, runnable page that shows the problem. I do not believe the actual database and datasource will be necessary, as  they are not relevant to the way the controls are accessed and created. The steps from this blog post can be helpful in isolating the sample.


Kind regards,
Marin Bratanov
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
Window
Asked by
Peter
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or