hi,
call method in rowcommand event
cmd = new SqlCommand("select ID_FUNC, ROLES from Role_master where ID_FUNC IN (select ID_FUNC from Function_master where [FUNCTION]='" + Function_DrpDown.SelectedItem.Text + "')", cnn);
Put boundfield true
call search function in pageindexchange event and clarthe controls while editing