Check out the following forum post which explains almost similar kind of scenario.
Update Grid's control from Popup window
The only difference is that the TextBox is inside TemplateColumn and the above code is for insertform. So make necessay changes apply the same logic.
Hope this information helps,