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

Refreshing a control on parent after window close.

9 Answers 116 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jure
Top achievements
Rank 1
Jure asked on 06 Sep 2010, 09:07 AM
Hey!
I am using RadWindow to post some comments.
On the main page I have a listview with items, every item has a button named comment, when you click the comment button a new radWindow pops up with a text box and submit button. When you click the submit button the comment is posted and the comment radWindow is closed. Now I need to refresh the listview on parent page with listView.DataBind() command... But I am having some problems in doing that.

Sincerely, Jure

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 06 Sep 2010, 09:35 AM
Hi Jure,


Attach OnClientClose to RadWindow and in the handler, invoke an ajaxRequest to server. Now in the server code (AjaxMAnager_AjaxRequest) refresh the ListeVew control.

Feel free to write again if you need further help,


Thanks,
Princy.
0
TSCGlobal
Top achievements
Rank 1
answered on 16 Nov 2010, 09:13 PM
Heyas;

How would this work using the Ajax Manager proxy?  For example, I have a master page.  In the content page I have the proxy control, a window manager, 3 windows, and a data grid.  Selecting a record in the data grid provides a form to fill out.  Clicking the "submit" button should submit the form, and close the window.  When the window closes, the grid should rebind.  I've tried setting it up similarly to what some of the other posts suggest, but I am having no success. I am hoping to get help.  Here's the relevant code:

ASPX Code:
<!-- Begin AJAX Code -->
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" UpdatePanelHeight="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="CreditsGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1"
                    UpdatePanelHeight="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<!-- End AJAX -->
 
<!-- Windows Begin -->
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow runat="server"
            ID="CreditsWindow"
            VisibleOnPageLoad="false"
            OnClientClose="closeRadWindow"
            NavigateUrl="CreditsWindow.aspx"
            Title="Credit transaction review"
            Width="600" Height="550" />
             
        <telerik:RadWindow runat="server"
            ID="CLTRWindow"
            VisibleOnPageLoad="false"
            Title="Help - Datagrid"
            Width="600" Height="450"
            NavigateUrl="" />
             
        <telerik:RadWindow runat="server"
            ID="NCRWindow"
            VisibleOnPageLoad="false"
            Title="Help - Datagrid"
            Width="600" Height="450"
            NavigateUrl="" />
    </Windows>
</telerik:RadWindowManager>
<!-- Windows End -->
 
<!-- Javascript begins -->
<script type="text/javascript">
    function openRadWin()
    {
        radopen(null, "GridHelpWindow");
    }
    function closeRadWindow()
    {
        $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest();
    
</script
<!-- Javascript ends -->

If possible, I would like to simply call the following function in the code behind from the OnClientClose event:
Sub Refresh()
     
    ProcessReview()
    CreditsGrid.DataBind()
 
End Sub
0
Georgi Tunev
Telerik team
answered on 18 Nov 2010, 01:19 PM

Hi beemer,

To make an Ajax request, you need to get a reference to the Ajax manager in the main page, not the proxy. Please check this help article for more details:
http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html

All the best,
Georgi Tunev
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.
0
Steve Napurano
Top achievements
Rank 1
answered on 10 May 2011, 04:57 AM
Hi I am trying to find a solution to the SAME thing, could you show me how you did it PLEASE.

Appreciate it!!!

Steve
0
Shinu
Top achievements
Rank 1
answered on 10 May 2011, 10:38 AM
Hello Steve,

Give a try with the following approach in the demo.
Window / Edit Dialog for RadGrid

Hope it helps.

Thanks,
Shinu.
0
Terry
Top achievements
Rank 1
answered on 25 May 2011, 04:41 PM
The example you reference has the AjaxManager on the same page.  I and the others asking the question have the Ajax Manager on a Master Page.  The <Script> does not recognize the AjaxManager, it does not compile.
How do you refrsh a RadGrid when you have an AjaxManagerProxy on the page and an AjaxManager on a Master page?
0
Georgi Tunev
Telerik team
answered on 26 May 2011, 12:41 PM
Hello Terry,

 You can get a reference to the proxy by using the syntax shown in article linked in the reply from 18 Nov. 2010. For convenience I am pasting part of the code below:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    function myUserControlClickHandler() {
        $find("<%= RadAjaxManager.GetCurrent(PageClientID %>").ajaxRequest("content");
    }
</script>
</telerik:RadCodeBlock>


All the best,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start 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.

0
Terry
Top achievements
Rank 1
answered on 01 Jun 2011, 05:55 PM
I have an Ajax Manager on a Master Page.  I am having trouble refreshing a RadGrid when I have an AjaxManagerProxy on the page and an AjaxManager on a MasterPage.
I also have RadDatePicker controls on the page.  When I first load the page, one datepicker displays the start of the week and the other datepicker control displays the end of the week.
If I open the RadWindow, make changes and close the RadWindow, the grid refreshs fine.
If I choose start and end dates one month (or any time frame i nthe future) in the future, open the RadWindow and make changes.  When I close the RadWindow, the page assumes it is not a Post Back and reloads the page, resetting the start and end dates to the current week.
I need the grid to refresh without changing the value in the RadDatePicker.
Is this possible?
0
Georgi Tunev
Telerik team
answered on 03 Jun 2011, 03:11 PM
Hello Terry,

If the datepickers are outside of the grid and only the grid is updated via Ajax request, pickers' values should not be reset. To be able to help further however, I need to get a better view over your exact case. Please open a support ticket and send me a small sample project that isolates the problem so I can investigate further.

Kind regards,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start 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
Window
Asked by
Jure
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
TSCGlobal
Top achievements
Rank 1
Georgi Tunev
Telerik team
Steve Napurano
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Terry
Top achievements
Rank 1
Share this question
or