In my GridView I have columns called 'F Notes', 'P Notes' and a ImageColumn. After clicking on the ImageButton a popup opens showing the data in the 'F Notes' and 'P Notes'. Now my problem is I do not want the 'F Notes' and 'P Notes' columns to be shown in the background when the pop up opens. I want the data to be visible only in the popup. I know if I change Visible = false then the column will not be shown but when I do that the text in the pop up is not visible.
Below is my code for both HTML and aspx.cs:
<asp:BoundField DataField="FNotes" HeaderText="F Notes" Visible="False" SortExpression="FNotes" />
<asp:BoundField DataField="PNotes" HeaderText="P Notes" Visible="False" SortExpression="PNotes" />
<asp:TemplateField HeaderText="Notes">
<ItemTemplate>
<asp:ImageButton ID="btnShowPopup" runat="server" Visible='<%#true.Equals(Eval("notesVisible"))%>' ImageUrl="~/Images/Imgs.jpg" Height="30px" Width="30px" OnClick="Popup" />
</ItemTemplate>
</asp:TemplateField>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView1.Columns[2].Visible = true;
GridView1.Columns[3].Visible = true;
}