teleriktelerik-gridradgrid

Telerik Radgrid event handler for insert not working?


I am trying to add an event handler for the OnInsertCommand event.

In the radgrid tag on the aspx page I have set

OnInsertCommand="RadGrid1_OnInsert"

In the code behind page I have

protected void RadGrid1_OnInsert(object sender, Telerik.Web.UI.GridItemEventArgs e)

However I am receiving the following error when I try to access the page:

No overload for 'RadGrid1_OnInsertCommand' matches delegate 'Telerik.Web.UI.GridCommandEventHandler'


Solution

  • I guess it is ASP.Net Web Form. Event argument should be GridCommandEventArgs.

    protected void RadGrid1_InsertCommand(object source, 
       GridCommandEventArgs e)
    {
        ...
    }
    

    For the good practice, you want to name the event name to be XXX_InsertCommand.