You have to bind gridview on bast of search condition.
if you want to serch by name then your query will be,
Select * from finalsort where name=@name
@name is a parameter which should be passed from code behind...:)
then you can bind gridview with Datatable.