Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ItemCommand on datagrid in UserControl not firing

Status
Not open for further replies.

kafmil

Technical User
Jul 15, 2002
71
AU
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top