Re: GridView RowCommand event not firing!!



Kevin Attard wrote:
I am using a GridView inside a UserControl which has a template
column for deleting the rows. Before databinding the gridview i am
attaching the RowCommand and RowDataBound event.

I am using the RowDataBound event to set the commandargument of the
delete button. The event is being fired and works fine.

When I press the delete button, the RowCommand event is not firing!
and neither is the RowDeleting (the button's commandName is "Delete")
Any idea why?

Do not databind on postback.
Use a construct like:
If(Not Page.IsPostback) Then
GridView1.DataBind()
End If

If you databind again on postback, the event handling of child buttons is
broken.

--

Riki


.