Hidden fields in a grid won't import to a edit form
<p>I've got a grid that only displays one piece of information such as a title. Other fields are hidden. When you click edit a modal popup displays a form and imports the information from the grid for editing. The information in hidden field are not imported though. I don't want to display all the information in the grid because I have only room for the title.</p>

<p>How can I make this work? Thanks. Risho</p>

<pre><code>&lt;asp:GridView ID="gvForum" runat="server" DataSourceID="odsForumApproval" DataKeyNames="id" Width="200px"
RepeatColumns="1" DataKeyField="id" CssClass="gridview"
AutoGenerateColumns="False" GridLines="None" OnSelectedIndexChanged="_OnCommand"&gt;
&lt;AlternatingRowStyle CssClass="altbgcolor"  /&gt;
&lt;Columns&gt;                            
    &lt;asp:BoundField DataField="title" /&gt;

    &lt;asp:TemplateField &gt;
        &lt;ItemTemplate&gt;
            &lt;asp:HiddenField runat="server" ID="hfId" Value='&lt;%# Eval("id") %&gt;' /&gt;
        &lt;/ItemTemplate&gt;                                
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField &gt;
        &lt;ItemTemplate&gt;
            &lt;asp:HiddenField runat="server" ID="hfDesc" Value='&lt;%# Eval("description") %&gt;' /&gt;
        &lt;/ItemTemplate&gt;                                
    &lt;/asp:TemplateField&gt;

    &lt;asp:TemplateField &gt;
        &lt;ItemTemplate&gt;
            &lt;asp:LinkButton ID="lnkbtn" Text="Approve" runat="server" onclick="lnkbtn_Click"/&gt;
        &lt;/ItemTemplate&gt;                                
    &lt;/asp:TemplateField&gt;
&lt;/Columns&gt;
</code></pre>

<p></p>

<pre><code>protected void lnkbtn_Click(object sender, EventArgs e)
{

    LinkButton btndetails = sender as LinkButton;

    GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;

    lblID.Value = gvrow.Cells[1].Text;

    txtTitle.Text = gvrow.Cells[0].Text;

    lblMessage.Text = gvrow.Cells[3].Text;

    this.ModalPopupExtender1.Show();

}
</code></pre>
