M
MattB
I'm trying to wire up a delete even for a datagrid and my even isn't
firing. I think I'm just not understanding something fundamental. Can anyone
tell me why this does not work and/or how to make it work?
Here's the datagrid declaration:
<asp:datagrid id="CartGrid" style="Z-INDEX: 101; LEFT: 48px; POSITION:
absolute; TOP: 176px" runat="server"
OnDeleteCommand="CartGrid_Delete" GridLines="None" BorderWidth="0px"
BackColor="Transparent" BorderStyle="None" Width="624px"
Font-Names="Verdana">
<AlternatingItemStyle BackColor="#FFFFCC"></AlternatingItemStyle>
<HeaderStyle Font-Names="Verdana" Font-Bold="True"
VerticalAlign="Top"></HeaderStyle>
<Columns>
<asp:ButtonColumn Text="Delete" ButtonType="PushButton"
CommandName="Delete"></asp:ButtonColumn>
<asp:BoundColumn DataField="Qty" HeaderText="Qty"></asp:BoundColumn>
<asp:BoundColumn DataField="descrip"
HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="ModDCI"
HeaderText="Modifier"></asp:BoundColumn>
<asp:BoundColumn DataField="guest"
HeaderText="Guest"></asp:BoundColumn>
<asp:BoundColumn DataField="Price"
HeaderText="Price"></asp:BoundColumn>
</Columns>
</asp:datagrid>
--------------------------------
Then in the codebehind, I have this event:
Sub CartGrid_Delete(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
.... 'delete row from datatable
EndSub
firing. I think I'm just not understanding something fundamental. Can anyone
tell me why this does not work and/or how to make it work?
Here's the datagrid declaration:
<asp:datagrid id="CartGrid" style="Z-INDEX: 101; LEFT: 48px; POSITION:
absolute; TOP: 176px" runat="server"
OnDeleteCommand="CartGrid_Delete" GridLines="None" BorderWidth="0px"
BackColor="Transparent" BorderStyle="None" Width="624px"
Font-Names="Verdana">
<AlternatingItemStyle BackColor="#FFFFCC"></AlternatingItemStyle>
<HeaderStyle Font-Names="Verdana" Font-Bold="True"
VerticalAlign="Top"></HeaderStyle>
<Columns>
<asp:ButtonColumn Text="Delete" ButtonType="PushButton"
CommandName="Delete"></asp:ButtonColumn>
<asp:BoundColumn DataField="Qty" HeaderText="Qty"></asp:BoundColumn>
<asp:BoundColumn DataField="descrip"
HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="ModDCI"
HeaderText="Modifier"></asp:BoundColumn>
<asp:BoundColumn DataField="guest"
HeaderText="Guest"></asp:BoundColumn>
<asp:BoundColumn DataField="Price"
HeaderText="Price"></asp:BoundColumn>
</Columns>
</asp:datagrid>
--------------------------------
Then in the codebehind, I have this event:
Sub CartGrid_Delete(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
.... 'delete row from datatable
EndSub