In the event handler for ItemCommand, I am trying to read text of cells in
the row programmaticall y, but can't get it working.
//this is what I have in InitializeCompo nent
this.dgList.Ite mCommand += new
System.Web.UI.W ebControls.Data GridCommandEven tHandler(this.d gList_Command);
//this is the event handler.
private void dgList_Command( object sender, DataGridCommand EventArgs e)
{
if(e.CommandNam e == "View")
{
Response.Write( e.Item.Cells.Co unt);
Response.Write( e.Item.Cells[0].Text);
}
}
When the button is command button is pressed, I am trying to read the text
in the first cell (e.Item.Cells[0].text), but nothing is showing up. I do
see that it recognizes eItem.Cells.Cou nt and shows the number of cells as
expected. But I do I read the contents of the cell in that row?
PS: I don't have Visual Studio 03 installed. Could this be a bug?
the row programmaticall y, but can't get it working.
//this is what I have in InitializeCompo nent
this.dgList.Ite mCommand += new
System.Web.UI.W ebControls.Data GridCommandEven tHandler(this.d gList_Command);
//this is the event handler.
private void dgList_Command( object sender, DataGridCommand EventArgs e)
{
if(e.CommandNam e == "View")
{
Response.Write( e.Item.Cells.Co unt);
Response.Write( e.Item.Cells[0].Text);
}
}
When the button is command button is pressed, I am trying to read the text
in the first cell (e.Item.Cells[0].text), but nothing is showing up. I do
see that it recognizes eItem.Cells.Cou nt and shows the number of cells as
expected. But I do I read the contents of the cell in that row?
PS: I don't have Visual Studio 03 installed. Could this be a bug?
Comment