Harold Sota
Harold Sota

Reputation: 7566

asp.net gridview edit button click error

I have this exception i have a asp.net gridview with select edit and delete button when i click edit or delete i have this bug. the gridview is inside a update pane

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The GridView 'combinationViewGridView' fired event RowEditing which wasn't handled.

any ideas

Upvotes: 1

Views: 3346

Answers (4)

rlee923
rlee923

Reputation: 768

Do you actually edit the row on the codebehind? If you are not just use commandName="Select"

Upvotes: 1

Saturn K
Saturn K

Reputation: 2785

On your ASPX page
<asp:GridView id="myGV" OnRowEditing="myGV_RowEditing" OnRowDeleting="myGV_RowDeleting" ...

On your code behind
protected void myGV_RowEditing(object sender, GridViewEditEventArgs e) {}

protected void myGV_RowDeleting(object sender, GridViewDeleteEventArgs e) {}

Upvotes: 1

Joel Etherton
Joel Etherton

Reputation: 37523

Even if the code to handle the update isn't in the rowEditing event, the event must be handled at the page level. You will need to add the event in your code behind and then just return false or exit sub (for vb) to allow the update panel to proceed with its mojo.

Upvotes: 2

Paddy
Paddy

Reputation: 33857

You haven't handled the rowEditing event in your code behind, which is required. Handle the event.

Upvotes: 1

Related Questions