tags:

views:

10

answers:

1

I have a GridView tied to an XmlDataSource to take advantage of the edit/update/delete capabilities GridView inherently offers. XmlDataSource offers no update event handling so that must be performed manually. I have no problem with this.

My problem is how/where can I catch this update event to perform my custom handling.

+1  A: 

Could you handle the

protected void grvFoo_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

    }

Calling

e.Cancel = true;

Eg

protected void grvFoo_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        //Your XML update code here

        //Cancel the gridview calling the update
        e.Cancel = true;
    }

And on in the grids columns either have

asp:CommandField ShowEditButton="true"

Or a Button, within a template field, which CommandName = "Update" as this should trigger that event also.

Jammin
Yeh that totally works setting e.Cancel = true for the RowUpdating event handler. Thanks alot for the feedback Jammin.
Rob Segal