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

RadAjaxpanel not updating controls inside it

4 Answers 460 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 08 May 2013, 07:16 AM
Hi Guys,

I have a radajaxpanel on a page. inside the radajax panel, i have a radgrid, a button, a label and a radwindow.

On the click event of the button, i am showing the radwindow using RadWindow.visibleOnLoad = true 

On RadWindow, i have a button, on the click event of this button, i am deleting some rows from the database and setting up a message on the label and also setting it's visible property to true. I am also using radGrid.Rebind() , radGrid.SelectedIndexes.Clear() and RadWindow.visibleOnLoad = false

But none of these controls are updating after the request. Pop is still visible, label is not visible and radgrid is not refreshed.

So i wrote some javascipt code

//Close pop up
            string script = string.Format("$find('{0}').close();", radwindowClearReason.ClientID);
            pnlProcessList.ResponseScripts.Add(script);
            //Clear selected rows
            script = string.Format("$find('{0}').clearSelectedItems();", grdProcessList.ClientID);
            pnlProcessList.ResponseScripts.Add(script);
            //refresh grid
            script = string.Format("$find('{0}').ajaxRequest();", pnlProcessList.ClientID);
            pnlProcessList.ResponseScripts.Add(script);

in the above code , pnlProcessList is the ID of RadAjaxPanel. This code is successfully closing the radWindow, refreshing the radGrid.

But still have two problems, selected indexes are not cleared and label is not visible.

Please help me on this. I am not sure what i am doing wrong.

Thanks,
Gaurav

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 13 May 2013, 10:06 AM
Hi Gaurav,

I am attaching a sample project illustrating the scenario you describe.
On click of the button in the window a deselect event is fired for all selected items in the grid. Also the selected indexes count is shown in a second label below the "Open window" button.

Give this code a try and let me know if it is helpful to you.
If not would you give more details on what you want to achieve? Could you share your full source code with code-behind? This will allow me to assist you further.

Regards,
Victor Tachev
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.
0
Gaurav
Top achievements
Rank 1
answered on 15 May 2013, 07:17 AM
Hi Victor,
I ran your code and it is working fine. The only difference in my setup and your sample project is that the content template in Radwindow is wrapped inside the RadAjaxPanel. I already tried the same solution you posted and found it working. But i want that button on the Radwindow to be ajax enabled.

When i put the content template into RadAjaxPanel in the sample project, it is also not working.

Please suggest how this could be achieved in this case.

Thanks,
Gaurav
0
Accepted
Viktor Tachev
Telerik team
answered on 17 May 2013, 10:40 AM
Hello Gaurav,

It is not supported to nest RadAjaxPanel controls. In more complex cases as your seems to be it is recommended using RadAjaxManager control as it could handle any scenario. More information on RadAjaxManager could be found in this article.

The RadWindow needs to initiate a postback request in order for it to be closed. If the button initiates an Ajax request the window would not be closed. Could you give more information on your scenario? Also what do you mean by the button in the RadWindow  to be Ajax-enabled? If it closes the window why would you need an Ajax request from the button. Do you have additional controls in the RadWindow that need to be updated?

Would you share full source code so everyone who would like to assist you could better understand your case?

Kind regards,
Victor Tachev
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.
0
Goraksh
Top achievements
Rank 1
answered on 31 Jul 2013, 12:02 PM
Gud....thnx dude!!! u r code worjed for me
Tags
Ajax
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Gaurav
Top achievements
Rank 1
Goraksh
Top achievements
Rank 1
Share this question
or