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

Showing a message in another panel

4 Answers 99 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Das
Top achievements
Rank 1
Das asked on 06 Jan 2009, 05:14 AM
Hi,
I have two panels in a page. While one panel contains master grid, the other grid has the child grid and a label. The two grids are Ajax Enabled. Based on the paging or sorting or filtering the master grid should refresh the child grid based on the first record. If there are no records the label saying "No records are found." should be displayed. I managed to refresh the child grid based on master grid but not able to show the label. PFB the code sample which I use:

                if (rgChild.Visible == true)
                {
                    rgMaster.ResponseScripts.Add(String.Format("window['{0}'].AjaxRequest('{1}', '');", rgChild.ClientID, rgChild.UniqueID));
                }
                else
                {
                        //I want the code to display the label here. Should I use some response script. If yes how?
                 }

Any suggestions are highly appreciated.

4 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 08 Jan 2009, 02:48 PM
Hello Das,

From your code I conclude that you are using the ASP.NET version of RadGrid and its internal ajax mechanism to perform ajax requests. Is my assumption correct? If so, consider migrating to the ASP.NET AJAX version of the control and use RadAjaxManager to ajaxify both grids as shown in this example:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/SelectedValue/DefaultCS.aspx

Then you can use the ResponseScripts collection of the ajax manager to notify the end user about the operations that took place/output some friendly message. Your account details indicate that you are using a trial version of our controls, hence migrating to their ASP.NET AJAX counterpart should not be a problem.

To speed up the upgrade process, review the topic from the online documentation linked below:

http://www.telerik.com/help/aspnet-ajax/grdmigrationtoprometheus.html

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Das
Top achievements
Rank 1
answered on 12 Jan 2009, 06:27 AM
Thanks for your help Sebastian. I appreciate it. Using RADAjaxManager would actually make the life easy. But we are having some specific requirements which requires the enabling of Ajax for each grid and thereby showing the AjaxLoading Panel. I am able to refresh the grids using Response Scripts. But was not able to do it for other controls. For example one of the controls have an image which I need to change. Please help me out with this. Thanks for your time.
0
Accepted
Sebastian
Telerik team
answered on 12 Jan 2009, 08:24 AM

Hi Das,

You can not update external controls using the built-in ajax for the grid because it allows to refresh controls which are part of the grid body only. Using RadAjaxManager can produce the same results and allows you to specify more granular settings to define the update conditions between different controls on the same page.

Furthermore, to display ajax loading panel during the ajax requests, simply drag AjaxLoadingPanel on the page and set its id via the updated controls' LoadingPanelID property. In case you want to stick to the ASP.NET versions of the controls instead of moving to their ASP.NET AJAX counterparts, review the demos of RadAjax Classic here:

http://demos.telerik.com/aspnet/Ajax/Examples/Manager/FirstLook/DefaultCS.aspx
 
Best,

Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Das
Top achievements
Rank 1
answered on 12 Jan 2009, 08:37 AM
Thanks mate. That was helpful. Thanks for your time.
Tags
Ajax
Asked by
Das
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Das
Top achievements
Rank 1
Share this question
or