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

Validation Not Firing after Window.AjaxRequest

1 Answer 50 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
sunil
Top achievements
Rank 1
sunil asked on 04 Mar 2014, 10:40 AM
hi,

asp validation controls not firing after ajaxrequest been called.

i'm calling a function with below code to refresh a grid.

window[<My Grid Client ID>].AjaxRequest(<My Grid Unique ID>, 'Rebind');

after grid refreshed, validation not firing on clicking of submit button for the first time. for the next click it is working fine.

Hope this is due to ajax problem.

does any one came across this scenario...?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 07 Mar 2014, 07:27 AM
Hello Sunil,

In order to initiate grid refresh you should find the client-side API of the grid and use the MasterTableView to fire "Rebind" command. Bellow is a simple example of that approach:
<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function refreshGrid() {
            var grid = $find("<%=RadGrid1.ClientID%>");
            var masterTableView = grid.get_masterTableView();
            masterTableView.fireCommand("Rebind");
        }
    </script>
</telerik:RadCodeBlock>
 
<telerik:RadButton ID="RadButton1" runat="server" Text="Refresh grid" AutoPostBack="false" OnClientClicked="refreshGrid">
</telerik:RadButton>
 
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
</telerik:RadGrid>

More information on this is available at the following help articles:

Hope that helps.


Regards,
Konstantin Dikov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Tags
Ajax
Asked by
sunil
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or