I have a GridView with a ButtonField of type link
<asp:ButtonField ButtonType="Link" CommandName="more" HeaderText="Name Expands" DataTextField="name" />
When the buttonField is pressed, I want to show one extra cell, in the next column. BUT I don't want to show the whole column, just the cell on that column that belongs to that row.
so i created the following
protected void gv2_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "more")
and e.CommandArgument tells me the number of row that was pressed
if now I say "gv2.Columns[3].Visible = true; the whole extra column goes visible, here i would like to show only one cell from that column.
and if I say:
gv2.Rows[Convert.ToInt32(e.CommandArgument)].Visible = true;
then the extra column with the field I want stays invisible.
how can I do that?
Many Thanks!