Hi,
I think you are already displaying data in the gridview when loading the form.Why bother a call to the database again.
Here is an example where you can use the datatable which is used as datasource to the Gridview.
<pre lang="c#">
string expression ="[Collector ID] like '%" + txtCollectorid.Text + "%'";
//Make sure the ColumnName Collector ID is same as Displayed in the gridview.
DataRow[] filteredRows=table.Select(expression); //table is the Datatable
if (filteredRows.Any()) //If any rows are matching
{
dtfilter = filteredRows.CopyToDataTable();
}
by doing so you can avoid call to database.