Grid edit command alters buttons client-side event

2 posts, 1 answers
  1. Adam
    Adam avatar
    2 posts
    Member since:
    Mar 2012

    Posted 19 Dec 2012 Link to this post

    I have a RadGrid with single row edit capability, and a button that acts as a "Submit" button.  I'm handling the grid's UpdateCommand event on the server, doing some processing, and trying to change the submit button's OnClientClick event.  Basically, depending on what happens when the server processes the update, I want the submit button to hit one of a few different js functions.  I'm having trouble reliably updating the button's event.  It seems as though it needs a full page postback to take effect.  What is the recommended approach for this?
  2. Answer
    Eyup avatar
    3795 posts

    Posted 24 Dec 2012 Link to this post

    Hi Adam,

    Thank you for contacting us.

    You can use the following approach ( for RadButton and regular asp Button ):
    protected void Page_Load(object sender, EventArgs e)
        RadButton1.OnClientClicked = "clientSideFunction";
        RadButton1.AutoPostBack = false;
        AspButton1.OnClientClick = "clientSideFunction(this,event);return false;";
    function clientSideFunction(sender, args) {
        // execute custom logic

    I hope this will prove helpful. Please give it a try and let me know about the result.

    All the best,
    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.
Back to Top