dropdownlist in footer row of gridview being clear on postback
<p>I am using a <code>dropdownlist</code> in footer row of <code>gridview</code>(<code>ASP.Net</code>) and I fill that on <code>rowdatabound</code> event,first time it works fine but when the form is postbacked,dropdown gets cleared.</p>

<p>It can be solved by refilling it on each postback,but I want that only single time code binding call fulfill my need,
means is there any way to stop from being null on postback.</p>

<p>looking for your kind solutions and suggestions
Thnx in advance......</p>

<p>Supriya</p>

<p>Code:</p>

<p>protected void gvProjects_RowDataBound(object sender, GridViewRowEventArgs e)
    {</p>

<pre><code>    try
    {

        if (gvProjects.Rows.Count &gt; 0 &amp;&amp; e.Row.RowIndex != -1)
        {
            string proj_Id = Convert.ToString(gvProjects.DataKeys[e.Row.RowIndex].Value);
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DropDownList ddlProject = (DropDownList)e.Row.FindControl("ddlProject");
                if (ddlProject != null &amp;&amp; ddlProject.Items.Count == 0)
                {
                    objMaster.FillProjects(ddlProject);
                    ddlProject.SelectedValue = proj_Id;
                }
            }

        }
    }
    catch (Exception excep)
    {
        lbl_msg.Text = excep.Message;
    }
}
</code></pre>

<p>It's called whenever the grid is binded,can it be avoided.</p>
