in the onclick event of your button:
Button btn = (Button)sender;
GridViewRow row = (GridViewRow)btn.NamingContainer;
By using this code you have the gridview row in which the button was clicked.
TextBox myTextBox = (TextBox)row.FindControl("nameOfYourTextBoxHere");
if (myTextBox != null) // control is found)
myTextBox.Text = "any text you wnat to place in the textbox";