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

[Solved] Javascript validation for custom commands before sending to server

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 10 Apr 2013, 01:22 PM
Hi, 

I have ajaxified RadGrid and in CommandItemTemplate I have RadToolBar with several buttons for my custom actions for data in the grid, which I handle in RadGridResults_ItemCommand(object sender, GridCommandEventArgs e).

In that function firstly I perform some validations before I continue working with those data. But I think some of those validations can be done by javascript on client side but I don't know how to do that. Could you advice me how to implement when user clicks on RadToolBarButton firstly some javascript function will be called where some conditions will be evaluated and if everything will be correct, it will be sent to server where RadGridResults_ItemCommand function will handle them.

Thanks for any help, 

Peter



1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 15 Apr 2013, 10:49 AM
Hello Peter,

Could you please elaborate more on the type of validation that you will be integrating in your project? You can easily integrate the ASP.NET validators in your project as demonstrated in this demo. If you want to create your own custom logic to validate the input you will have to intercept the client click event of the button that will trigger the insert.

Kind regards,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or