i have a datalist and inside it there is many rows and in one of these rows i have a gridview,. i can say that it's like the following
<DataList>
<tr>
<td> [textbox1 control] </td>
</tr>
<tr>
<td> [textbox2 control] </td>
</tr>
<tr>
<td>
<gridview/>
</td>
</tr>
</DataList>
my problem is when i'm in gridview RowCommand handler i want to get the data that exist in [textbox1 control] and [textbox1 control]
i do the following
DataListItem dataListItem = (DataListItem)((GridView)sender).Parent.Parent.Parent.Parent;
string txt = ((TextBox)dataListItem.FindControl([textbox1 control])).Text.Trim();
but is this the only way to ?