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

refreshing radgrid and labels on radwindow close

0 Answers 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
Edd
Top achievements
Rank 1
Edd asked on 23 Nov 2014, 11:30 AM
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

No answers yet. Maybe you can help?

Tags
Window
Asked by
Edd
Top achievements
Rank 1
Share this question
or