DataGrid not calling ItemCommand Event

E

Ezequiel Pérez

Hi, I have a problem with a DataGrid, this datagrid is not calling the
ItemCommand event. I tried do to it defining the event as usual (from
the designer), but it didn't work, neither defining the event in the .aspx.

the aspx datagrid tag:

<asp:datagrid id="grdOilFields" runat="server" BorderColor="#999999"
GridLines="Vertical" HorizontalAlign="Center"
AutoGenerateColumns="False" Font-Names="Arial" Font-Size="X-Small"
CssClass="cssTabla" OnItemCommand="grdOilFields_ItemCommand">
<AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
<ItemStyle Height="24px" ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Height="24px"></HeaderStyle>
<Columns>
<asp:BoundColumn HeaderText="Descripción">
<HeaderStyle Width="145px" CssClass="LeftHeaderImage"></HeaderStyle>
<ItemStyle Width="145px"></ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn>
<HeaderStyle Width="45px" CssClass="RightHeaderImage"></HeaderStyle>
<ItemStyle Width="45px"></ItemStyle>
<ItemTemplate>
<asp:ImageButton id="btnDelete" runat="server"
ImageUrl="../Images/Buttons/DGDelete.gif"
CommandName="btnDelete"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>

the way I defined the event handler:

protected void grdOilFields_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
... some code which is never reached ...
}

if you have any ideas about why this event is never reached, please tell
me, thanks
 
A

Alvin Bruney

do you have data available?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top