我有 N 行和 9 列,其中两列只有在单击图像后才能看到。但是对于每一行,我希望图像只有在该列中有文本时才可见。请帮我。
<asp:BoundField DataField="Notes" HeaderText="Notes" Visible="False"
SortExpression="Notes" />
<asp:BoundField DataField="Notes" HeaderText="Notes" Visible="False"
SortExpression="Notes" />
<asp:ButtonField ButtonType="Image" ImageUrl="~/Images/Imgs.jpg"
Text="Button" />
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView1.Columns[2].Visible = true;
GridView1.Columns[3].Visible = true;
}