I have a user control which lists items from a cookie in a datagrid. I am using a datagrid because i need to add or subtract a value of one from the qty column displayed in the datagrid but the edititem never gets used as i don't want users changing figures directly. I have added two buttons on the screen to increase/decrease the qty of item.
<asp:TemplateColumn ItemStyle-Width="10">
<ItemTemplate>
<asp:ImageButton Runat="server" ID="cmdAdd" CommandName="add" ImageUrl="../images/add.gif"></asp:ImageButton>
<asp:ImageButton Runat="server" ID="cmdSub" CommandName="sub" ImageUrl="../images/sub.gif"></asp:ImageButton>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton Runat="server" ID="Imagebutton1" CommandName="add" ImageUrl="../images/add.gif"></asp:ImageButton>
<asp:ImageButton Runat="server" ID="Imagebutton2" CommandName="sub" ImageUrl="../images/sub.gif"></asp:ImageButton>
</EditItemTemplate>
</asp:TemplateColumn>
when i click one of these buttons for some reason the itemcommand event does not fire. Does anyone have any ideas?
Is it possible to use the item command in a datagrid inside a usercontrol? Is there another/better way to do this?
<asp:TemplateColumn ItemStyle-Width="10">
<ItemTemplate>
<asp:ImageButton Runat="server" ID="cmdAdd" CommandName="add" ImageUrl="../images/add.gif"></asp:ImageButton>
<asp:ImageButton Runat="server" ID="cmdSub" CommandName="sub" ImageUrl="../images/sub.gif"></asp:ImageButton>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton Runat="server" ID="Imagebutton1" CommandName="add" ImageUrl="../images/add.gif"></asp:ImageButton>
<asp:ImageButton Runat="server" ID="Imagebutton2" CommandName="sub" ImageUrl="../images/sub.gif"></asp:ImageButton>
</EditItemTemplate>
</asp:TemplateColumn>
when i click one of these buttons for some reason the itemcommand event does not fire. Does anyone have any ideas?
Is it possible to use the item command in a datagrid inside a usercontrol? Is there another/better way to do this?