inside the dropdownlist.selectedchange event
{
string str="select * from table name where Id="+dropdownlist.seletedvalue+";
SqlCommand cmd = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gridview.datasource=ds.tables[0];
gridview.databind();
}