refreshing radgrid and labels on radwindow close

1 posts, 0 answers
  1. Edd
    Edd avatar
    37 posts
    Member since:
    Jan 2013

    Posted 23 Nov 2014 Link to this post

    Hi All,
    I am using the below code to refresh a radgrid on radwindow close but this is the error i get. Can anyone help me solve this.
    Error
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

    Aspx
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"   
            onajaxrequest="RadAjaxManager1_AjaxRequest">  
            <AjaxSettings>  
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls>  
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
                    </UpdatedControls>  
                </telerik:AjaxSetting>  
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls>  
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
                    </UpdatedControls>  
                </telerik:AjaxSetting>  
            </AjaxSettings>  
        </telerik:RadAjaxManager> 
      
                                          <script type="text/javascript">
                                              function closeRadWindow() {
                                                  $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
    }
    </script> 

    Code
            protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
                {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                RadGrid1.Rebind();
                } 

            }

    Thanks in advance
Back to Top