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

Radgrid not refreshing on closing Radwindow

1 Answer 103 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mahesh
Top achievements
Rank 1
mahesh asked on 27 Jul 2011, 07:00 AM

Grid not rebinding on Closing Rad Window

I have problem with radgrid refreshing, when i close the radwindow .I have a radgrid which should refresh automatically when i close the radwindow , In my application i have a radwindow through which i will insert the values to database , on successfull insertion , i am calling the refresh grid function , but the grid refresh functionality is not working , can i know where exactly i am wrong ,so that the functionality works fine. 

my Gridpage aspx code looks like this
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" EnableAJAX="true">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
            GridLines="None" ShowGroupPanel="True" Skin="Black" AutoGenerateColumns="False" Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false">
            <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <ClientEvents OnGridCreated="OnGridCreated" />
            </ClientSettings>

.......................
..................
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
            Skin="Black">
            <Windows>
                <telerik:RadWindow ID="UserListDialog" runat="server" Height="620px" Width="620px"
                    Left="150px" Top="50px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"
                    OnClientClose="closeRadWindow" />
            </Windows>
        </telerik:RadWindowManager>
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                Presenter List = new Presenter(this);
                IList<FileAdmin> GridDta = List.PopulateGrid();
                RadGrid1.DataSource = GridDta;
                RadGrid1.Rebind();
            }
javascript looks like this
function closeRadWindow()
                 {
                     $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                  
                }
       function refreshGrid()
                 {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                 
                 }
RadWindow aspx code Looks like this
javascript
 function CloseAndRebind() {
                        GetRadWindow().BrowserWindow.refreshGrid();
                        //GetRadWindow().close();
                    }
function GetRadWindow()
                     {
                        var oWindow = null;
                        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
                        return oWindow;
                    }
Radwindow aspx.cs file looks like this
protected void buttonclick(object sender, EventArgs e)
{
if (result == true)
 {
ClientScript.RegisterStartupScript(Page.GetType(), "mykey1", "CloseAndRebind();", true);
 }
}

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 01 Aug 2011, 11:43 AM
Hello Mahesh,

The presented code looks ok to me.

Could I kindly ask you to open a regular support ticket and send us runnable version of your application. Thus we will be able to debug it locally and do our best to isolate the root cause of the problem you are facing.

Kind regards,
Maria Ilieva
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
Ajax
Asked by
mahesh
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or