ImageButton inside of a DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemcommand event when it is clicked. Does anyone have a link to a
tutorial or a solution for this problem?

For my datagrid I do have the OnItemCommand propert set.

<asp: Datagrid id="DataGrid1" runat="server" OnItemCommand="gStarted">

In the code the function is:

public sub gStarted(byval sender as object, byval e as
datagridCommandEventArgs) handles DataGrid1.itemCommand

This is not firing the event.
 
Hi,

first make sure that you are binding the grid in page_load inside "If Not
Page.IsPostBack Then" check. If you aren't (missing the check) it will
rebind the grid, and "eat" up the postback events.
 
That did it. Just started ASP and still getting used to the client/server and
postback things. Thanks a bunch. It threw me off because it was firing
linkbuttons in that same datagrid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top