Hi,
I have a texbox which is a template column of a grid and the grid is inside the repeater.
If there is only one control in the repeater then we can use
foreach (RepeaterItem item in Repeater1.Items)
{
TextBox FirstName = (TextBox)item.FindControl("txtFirstName");
Response.Write(FirstName.Text);
}
But I have a control inside a control of the repeater..So can anyone please help me.
Thanks
I have not used a design like this before but I would try to access the datagrid within the repeater so that you can get the value of your TextBox.
foreach(RepeaterItem item in Repeater1.Items)
{
DataGrid dg = (DataGrid)item.FindControl("dgNameofGrid");
for(int i = 0; i < dg.Items.Count; i++)
{
TextBox FirstName = (TextBox)dg.Items[i].FindControl("txtFirstName");
Response.Write(FirstName.Text);
}
}
I haven't tested this but give it a shot. Hopefully it will get you on the right track.
Nathan