I’m attempting to get the cell value from a gridview but running into a few issues. I have setup my code similar to this example except that I’m adding my button fields on the server side. For some reason RowCommand is firing twice when clicking the cell values? TIA for any help
Page Load is empty:
code
protected void Page_Load(object sender, EventArgs e)
{
}
Adding Button Field:
code
foreach (DataColumn col in transposedTable.Columns)
{
ButtonField bfield = new ButtonField();
bfield.DataTextField = col.ColumnName;
bfield.HeaderText = col.ColumnName;
bfield.CommandName = "ColumnClick";
gvTest.Columns.Add(bfield);
}
The RowDataBound and RowCommand events are the same as the example link above
ok…There seems to be an open bug in MSFT connect…
GridView RowCommad Event Firing Twice
seems like there are some workarounds posted in the Workarounds tab…
Hope this helps…