ASP.NET ListView Search & Edit not working
<p>I've got a ASP.NET ListView with search function. After retrieving a search result when I click on Edit button, the ListView Reresh and brings back the full list with edit mode selected on wrong record.</p>

<blockquote>
  <p>e.g. Lets say I've 100 records on list
  view. After search I've 2 records
  displayed. When I click Edit button it
  retrieves 100 records with wrong Edit
  Row selected.</p>
</blockquote>

<p>Could some please suggest what I should do to fix this bug.</p>

<p>Here's the code for search:</p>

<pre><code>protected void btnSearch_Click(object sender, EventArgs e)
{
    DS.SelectCommand = 
      "SELECT ReportName, ReportType, 
       FROM Table 
       WHERE ReportName LIKE @param 
       ORDER BY ReportType Desc";
   DS.SelectParameters.Add("Param", searchTxtBox.Text.Replace("'", "''"));
   DS.DataBind();
   ListView1.DataBind();               
}
</code></pre>
