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

How To Perform Last Action on RadGrid After applying AJAX

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Umesh
Top achievements
Rank 1
Umesh asked on 24 Feb 2009, 09:06 AM
Hi All,
I have  Made RadGrid AJAX enabled by using AjaxManager.
Right now Iam showing Loading image while it is doing asynchronous postback.
Now I want to perform last action(Insert/Update/Delete) on grid,if user tries to clicks on  'Add new record' or Delete or Update Button continuously.
Is there any way to do it.

Thanks,
Umesh

1 Answer, 1 is accepted

Sort by
0
shivraj
Top achievements
Rank 1
answered on 24 Feb 2009, 09:43 AM

Hi Umesh,

Please try the following code. The function disables the controls on page
while the ajax is proceesing any request and enables it again once the Process completed.

All you need to do is call DisableControls and EnableControls functions in RadAjaxManagers 
 <ClientEvents OnRequestStart="DisableControls" OnResponseEnd="EnableControls" />

Hope it may solve your problem.

 <script type="text/javascript">
            <!--
                function DisableControls()
                {
                    for (var i=0; i<document.forms[0].elements.length; i++)
                    {           
                        var obj = document.forms[0].elements[i];
                        obj.disabled = true;
                    }
                }
                function EnableControls()
                {
                    for (var i=0; i<document.forms[0].elements.length; i++)
                    {       
                        var obj = document.forms[0].elements[i];
                        obj.disabled = false;
                    }
                }
            -->
    </script>

 

 <telerik:AjaxSetting AjaxControlID="Button1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rbLoadingImagesChooser">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rbLoadingImagesChooser"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
            <ClientEvents OnRequestStart="DisableControls" OnResponseEnd="EnableControls" />
        </telerik:RadAjaxManager>

Tags
Grid
Asked by
Umesh
Top achievements
Rank 1
Answers by
shivraj
Top achievements
Rank 1
Share this question
or