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
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