S
Sriram
Hi,
I am populating a grid dynamically. Based on the data, I
populate some command buttons (control array) with a
CommandEventHandler assignment for Command event. I could able to see
the button. But CommandEventHandler is not not getting fired.
Here is the code snipet:
if (tempLbl.Text.ToString() == "Y/N")
{
Button adnlInfo1 = new Button();
adnlInfo1.ID = "btnAdnl" + dgRows.ToString();
adnlInfo1.CommandArgument =
dgmgItems.Items[dgRows].Cells[8].Text.ToString();
adnlInfo1.Command += new CommandEventHandler(this.btnAdnl_Command);
adnlInfo1.Text = "*";
btns[dgRows] = adnlInfo1;
dgmgItems.Items[dgRows].Cells[2].Controls.Add(btns[dgRows]);
}
CommandEventHandler is:
protected void btnAdnl_Command(object sender, CommandEventArgs e)
{
string strId = e.CommandArgument.ToString();
}
Could someone help me in this?
TIA
-Sri.
I am populating a grid dynamically. Based on the data, I
populate some command buttons (control array) with a
CommandEventHandler assignment for Command event. I could able to see
the button. But CommandEventHandler is not not getting fired.
Here is the code snipet:
if (tempLbl.Text.ToString() == "Y/N")
{
Button adnlInfo1 = new Button();
adnlInfo1.ID = "btnAdnl" + dgRows.ToString();
adnlInfo1.CommandArgument =
dgmgItems.Items[dgRows].Cells[8].Text.ToString();
adnlInfo1.Command += new CommandEventHandler(this.btnAdnl_Command);
adnlInfo1.Text = "*";
btns[dgRows] = adnlInfo1;
dgmgItems.Items[dgRows].Cells[2].Controls.Add(btns[dgRows]);
}
CommandEventHandler is:
protected void btnAdnl_Command(object sender, CommandEventArgs e)
{
string strId = e.CommandArgument.ToString();
}
Could someone help me in this?
TIA
-Sri.