-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vijaykishan
Message 1 in Discussion
Hi , I am working on asp.net/c# application. I have grid that displays a list
of product details. i want to have a link or button for each row . On click of
the link/button i want to perform certain action. [Code i wrote]
<form id="Form1" runat="server">
<asp:datagrid id="grdProducts" runat="server" AutoGenerateColumns="False"
CellPadding="3" BorderWidth="1px" BorderColor="Black"
OnItemCommand="ItemsGrid_Command">
<Columns>
<asp:BoundColumn DataField="ProductName"
HeaderText="Description"></asp:BoundColumn>
<asp:BoundColumn DataField="CategoryName"
HeaderText="Category"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Select">
<ItemTemplate>
<asp:Button ID="cmdInfo" Text="More Info" CommandName="Info"
Runat="server" ></asp:Button>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
<asp:label id="Label1" style="Z-INDEX: 102; LEFT: 776px; POSITION: absolute;
TOP: 120px" runat="server"
Height="24px" Width="160px">Label</asp:label>
</form> public void ItemsGrid_Command(Object sender,
DataGridCommandEventArgs e) {
if (e.CommandName == "Info" )
{
Label1.Text = "Vijay";
}
} [/code]
Please suggest me where is the problem and how to solve it. onitemcommand is
not firing for me.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]